Add docker-compose deploy path with Coolify-managed secrets
Adds docker-compose.yml so Coolify can provision Postgres and generate DATABASE_URL/SESSION_SECRET/TOKEN_ENCRYPTION_KEY/CRON_SECRET itself via its SERVICE_PASSWORD_* magic variables, instead of an operator typing them into the dashboard by hand. TOKEN_ENCRYPTION_KEY now derives its AES-256 key via SHA-256 instead of requiring exactly 32 raw bytes in base64, so a generated magic variable works regardless of its format. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
services:
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
environment:
|
||||
DATABASE_URL: postgresql://app:${SERVICE_PASSWORD_POSTGRES}@db:5432/app
|
||||
SESSION_SECRET: ${SERVICE_PASSWORD_64_SESSION}
|
||||
TOKEN_ENCRYPTION_KEY: ${SERVICE_PASSWORD_64_TOKENKEY}
|
||||
CRON_SECRET: ${SERVICE_PASSWORD_64_CRON}
|
||||
volumes:
|
||||
- web-data:/app/.data
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "-o", "/dev/null", "http://127.0.0.1:3000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 20s
|
||||
|
||||
db:
|
||||
image: postgres:17-alpine
|
||||
environment:
|
||||
POSTGRES_USER: app
|
||||
POSTGRES_PASSWORD: ${SERVICE_PASSWORD_POSTGRES}
|
||||
POSTGRES_DB: app
|
||||
volumes:
|
||||
- pg-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U app -d app"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
volumes:
|
||||
web-data:
|
||||
pg-data:
|
||||
Reference in New Issue
Block a user