39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
# Production stack for a home server (Phase 13): Postgres and the API server.
|
|
# From this folder: docker compose --env-file .env up -d --build
|
|
# Settings come from deploy/.env (copy .env.example).
|
|
name: deadhead
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:18
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-deadhead}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in deploy/.env}
|
|
POSTGRES_DB: ${POSTGRES_DB:-deadhead}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 30
|
|
|
|
server:
|
|
build:
|
|
context: ..
|
|
dockerfile: deploy/server.Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgres://${POSTGRES_USER:-deadhead}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-deadhead}
|
|
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:?set BETTER_AUTH_SECRET in deploy/.env}
|
|
BETTER_AUTH_URL: ${PUBLIC_URL:?set PUBLIC_URL in deploy/.env}
|
|
LOG_LEVEL: ${LOG_LEVEL:-info}
|
|
WORKERS_ENABLED: "true"
|
|
|
|
volumes:
|
|
postgres-data:
|