From b13dbf9adaaa30d7d3e35559e6eca56f0ee454e6 Mon Sep 17 00:00:00 2001 From: Moroine Bentefrit Date: Mon, 9 Sep 2024 08:48:06 +0200 Subject: [PATCH] fix: docker environment variable --- .infra/docker-compose.preview.yml | 4 ++-- .infra/docker-compose.production.yml | 4 ++-- server/src/{dev.ts => index.ts} | 0 server/tsup.config.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename server/src/{dev.ts => index.ts} (100%) diff --git a/.infra/docker-compose.preview.yml b/.infra/docker-compose.preview.yml index 27d9621537..ef45835277 100644 --- a/.infra/docker-compose.preview.yml +++ b/.infra/docker-compose.preview.yml @@ -20,9 +20,9 @@ services: - VIRTUAL_PORT=5000 - LETSENCRYPT_HOST={{pr_number}}.labonnealternance-preview.apprentissage.beta.gouv.fr - LETSENCRYPT_EMAIL=misson.apprentissage.devops@gmail.com - env_file: .env_server volumes: - server:/data + - ./.env_server:/app/server/.env healthcheck: test: ["CMD", "curl", "--fail", "http://localhost:5000/api/healthcheck"] interval: 10s @@ -49,9 +49,9 @@ services: image: "ghcr.io/mission-apprentissage/mna_lba_server:0.0.0-{{pr_number}}" container_name: lba_{{pr_number}}_jobs_processor command: ["yarn", "cli", "job_processor:start"] - env_file: .env_server volumes: - server:/data + - ./.env_server:/app/server/.env volumes: server: diff --git a/.infra/docker-compose.production.yml b/.infra/docker-compose.production.yml index 36b9a8d75b..c9358ce5ad 100644 --- a/.infra/docker-compose.production.yml +++ b/.infra/docker-compose.production.yml @@ -31,10 +31,10 @@ services: limits: memory: 2g replicas: 2 - env_file: .env_server stop_grace_period: 2m volumes: - /opt/app/data/server:/data + - /opt/app/.env_server:/app/server/.env logging: driver: "fluentd" options: @@ -57,10 +57,10 @@ services: limits: memory: 2g command: ["yarn", "cli", "job_processor:start"] - env_file: .env_server stop_grace_period: 5m volumes: - /opt/app/data/server:/data + - /opt/app/.env_server:/app/server/.env logging: driver: "fluentd" options: diff --git a/server/src/dev.ts b/server/src/index.ts similarity index 100% rename from server/src/dev.ts rename to server/src/index.ts diff --git a/server/tsup.config.ts b/server/tsup.config.ts index 50640ce307..465015933f 100644 --- a/server/tsup.config.ts +++ b/server/tsup.config.ts @@ -10,7 +10,7 @@ export default defineConfig((options) => { const migrationFiles = fs.readdirSync("./src/migrations") const entry: Record = { - index: isDev ? "src/dev.ts" : "src/main.ts", + index: "src/index.ts", } for (const file of migrationFiles) {