Switch compose from env_file to environment blocks
All checks were successful
Build and Deploy UMBRA / build-and-deploy (push) Successful in 52s

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) <noreply@anthropic.com>
This commit is contained in:
Kyle 2026-03-18 17:37:56 +08:00
parent 329c057632
commit d945de3837

View File

@ -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