From d945de3837e594fec4feb9589bed42ba23869069 Mon Sep 17 00:00:00 2001 From: Kyle Pope Date: Wed, 18 Mar 2026 17:37:56 +0800 Subject: [PATCH] Switch compose from env_file to environment blocks Replace env_file: .env with explicit environment: variables using ${VAR} substitution. Works with both .env files (local dev) and Portainer's environment UI (no .env file needed on the host). Co-Authored-By: Claude Opus 4.6 (1M context) --- docker-compose.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 736cac7..46da7b0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,10 @@ services: db: image: postgres:16-alpine restart: unless-stopped - env_file: .env + environment: + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + - POSTGRES_DB=${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data networks: @@ -22,7 +25,15 @@ services: image: git.sentinelforest.xyz/rohskiddo/umbra-backend:main-latest build: ./backend restart: unless-stopped - env_file: .env + environment: + - DATABASE_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} + - SECRET_KEY=${SECRET_KEY} + - ENVIRONMENT=${ENVIRONMENT:-production} + - UMBRA_URL=${UMBRA_URL:-https://umbra.ghost6.xyz} + - OPENWEATHERMAP_API_KEY=${OPENWEATHERMAP_API_KEY:-} + - WEBAUTHN_RP_ID=${WEBAUTHN_RP_ID:-umbra.ghost6.xyz} + - WEBAUTHN_RP_NAME=${WEBAUTHN_RP_NAME:-UMBRA} + - WEBAUTHN_ORIGIN=${WEBAUTHN_ORIGIN:-https://umbra.ghost6.xyz} depends_on: db: condition: service_healthy