From 8067980774a0570266855fc11159f66df3a91df6 Mon Sep 17 00:00:00 2001 From: Leon Serfaty <80597822+silkoserfo@users.noreply.github.com> Date: Mon, 7 Sep 2026 11:57:10 -0400 Subject: [PATCH] fix(deploy): inject Dokploy env into containers via env_file The compose services declared only STORAGE_DIR and PORT under `environment`, so DATABASE_URL, BETTER_AUTH_SECRET and the Turnstile keys never reached the containers: `docker compose` reads the generated .env for ${VAR} interpolation (build args) but does not pass it into services on its own. `prisma migrate deploy` therefore started with no DATABASE_URL and both containers exited 1 in a restart loop. Add `env_file: [.env]` to web and worker so the Environment tab actually becomes runtime configuration, as the file's own comment already claimed. Co-Authored-By: Claude Opus 5 (1M context) --- docker-compose.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 5319b8e..aada400 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,6 +17,12 @@ services: # Apply pending migrations on boot, then serve. command: sh -c "npx prisma migrate deploy && npm run start" restart: unless-stopped + # Dokploy writes the Environment tab into a .env beside this file. Compose uses + # that for ${VAR} interpolation (the build args above) but does NOT put it + # inside the container — env_file is what actually injects DATABASE_URL, + # BETTER_AUTH_SECRET, the Turnstile keys, etc. at runtime. + env_file: + - .env environment: STORAGE_DIR: /app/storage PORT: "3000" @@ -40,6 +46,8 @@ services: image: podcast-distribution-ai:latest command: npx tsx worker/index.ts restart: unless-stopped + env_file: + - .env environment: STORAGE_DIR: /app/storage volumes: