This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(directory): Basic directory for psychologists (#27)
* Add a basic psychologists pages * Add a healthz route * Change type directory * Add env variables * Add ts-node * Test .env * Add a nice geolocation * Use proper field * feat(ci): add seeds command (#28) * Test .env * feat: add db deploy * Use proper DB URL * fix: use devInitContainerCommand * Do a db migration in docker * run db:migrate * Fix build Co-authored-by: Desoindx <[email protected]> * Review * Update Readme * Manage 2A and 2B departments Co-authored-by: Julien Bouquillon <[email protected]>
- Loading branch information
Showing
46 changed files
with
3,205 additions
and
1,549 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
NEXT_TELEMETRY_DISABLED=1 | ||
DATABASE_URL=postgres://monpsysante:monpsysante@localhost:5432/monpsysante | ||
DB_LOGGING_ENABLE=true | ||
|
||
DEMARCHES_SIMPLIFIEES_TOKEN=api-token | ||
DEMARCHES_SIMPLIFIEES_ID=52209 | ||
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
NEXT_PUBLIC_MATOMO_URL=https://matomo.fabrique.social.gouv.fr | ||
NEXT_PUBLIC_MATOMO_SITE_ID="59" | ||
NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/61 | ||
|
||
NEXT_TELEMETRY_DISABLED=1 | ||
DB_LOGGING_ENABLE=false | ||
|
||
DEMARCHES_SIMPLIFIEES_TOKEN=api-token | ||
DEMARCHES_SIMPLIFIEES_ID=52209 | ||
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]] | ||
|
||
NEXT_PUBLIC_DISPLAY_DIRECTORY=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
NEXT_TELEMETRY_DISABLED=1 | ||
DB_LOGGING_ENABLE=false | ||
|
||
DEMARCHES_SIMPLIFIEES_TOKEN=api-token | ||
DEMARCHES_SIMPLIFIEES_ID=52209 | ||
DEMARCHES_SIMPLIFIEES_CHAMPS=[["Q2hhbXAtMTYwMzgwNQ==", "phone"], ["Q2hhbXAtMTYyNzkzOQ==", "address"], ["Q2hhbXAtMTYzOTUyNA==", "teleconsultation"], ["Q2hhbXAtMTY2MDM0Nw==", "languages"], ["Q2hhbXAtMTYzOTQwMQ==", "website"], ["Q2hhbXAtMjI0NzExMg==", "cdsmsp"], ["Q2hhbXAtMjIyMjcwMg==", "withChildren"]] | ||
|
||
NEXT_PUBLIC_DISPLAY_DIRECTORY=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/db/migrations/ | ||
src/db/config/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,9 @@ | |
.eslintcache | ||
coverage | ||
node_modules | ||
|
||
.env | ||
|
||
out/ | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
'config': path.resolve('./src/db/config', 'config.js'), | ||
'models-path': path.resolve('./src/db', 'models'), | ||
'migrations-path': path.resolve('./src/db', 'migrations'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
{ | ||
"name": "app", | ||
"type": "static", | ||
"type": "app", | ||
"subdomain": "monpsy", | ||
"registry": "ghcr", | ||
"project": "mon-psy-sante", | ||
"ingress": { | ||
"annotations": { | ||
"nginx.ingress.kubernetes.io/configuration-snippet": "more_set_headers \"Content-Security-Policy: default-src 'none'; connect-src 'self' https://*.gouv.fr https://services.sarbacane.com; font-src 'self' data:; img-src 'self' data: https://forms.sbc08.com; prefetch-src 'self' https://*.gouv.fr; script-src 'self' https://*.gouv.fr https://*.sbc08.com; frame-src 'self' https://*.gouv.fr; style-src 'self' 'unsafe-inline'\";\nmore_set_headers \"X-Frame-Options: deny\";\nmore_set_headers \"X-XSS-Protection: 1; mode=block\";\nmore_set_headers \"X-Content-Type-Options: nosniff\";" | ||
} | ||
} | ||
"azurepg": true, | ||
"devInitContainerCommand": ["yarn", "db:init"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
ARG PRODUCTION | ||
# from https://nextjs.org/docs/deployment | ||
|
||
FROM node:14-alpine as builder | ||
# Builder | ||
FROM node:14-alpine AS builder | ||
RUN apk add --no-cache libc6-compat | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile | ||
COPY . . | ||
|
||
RUN yarn install --frozen-lockfile | ||
RUN if [ -z "$PRODUCTION" ]; then cp .env.staging .env.production; cp ./public/robots.staging.txt ./public/robots.txt; fi | ||
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline | ||
RUN yarn export | ||
|
||
FROM ghcr.io/socialgouv/docker/nginx:6.64.2 | ||
# Production image, copy all the files and run next | ||
FROM node:14-alpine AS runner | ||
WORKDIR /app | ||
|
||
ARG PRODUCTION | ||
ENV NODE_ENV production | ||
|
||
COPY --from=builder /out /usr/share/nginx/html | ||
# You only need to copy next.config.js if you are NOT using the default configuration | ||
COPY --from=builder /app/next.config.js . | ||
COPY --from=builder /app/sentry.client.config.js . | ||
COPY --from=builder /app/sentry.server.config.js . | ||
COPY --from=builder /app/.sequelizerc . | ||
COPY --from=builder /app/.env.production . | ||
COPY --from=builder /app/package.json . | ||
COPY --from=builder /app/src ./src | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder --chown=node:node /app/.next ./.next | ||
|
||
# Create a robots.txt based on PRODUCTION build argument | ||
RUN if [ ! -z "$PRODUCTION" ]; then echo -e "User-agent: *\nAllow: /">/usr/share/nginx/html/robots.txt; else echo -e "User-agent: *\nDisallow: /">/usr/share/nginx/html/robots.txt; fi | ||
USER node | ||
|
||
CMD ["yarn", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "3.6" | ||
|
||
services: | ||
db: | ||
image: postgis/postgis:14-master | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
environment: | ||
POSTGRES_DB: monpsysante | ||
POSTGRES_USER: monpsysante | ||
POSTGRES_PASSWORD: monpsysante | ||
restart: always | ||
|
||
volumes: | ||
db_data: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
User-agent: * | ||
Disallow: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
User-agent: * | ||
Allow: / |
Oops, something went wrong.