- Create docker-compose.dev.yml with Postgres 16 for local development - Rewrite docker-compose.yml with Postgres service, healthcheck, and app dependency chain - Production uses externalized POSTGRES_PASSWORD and DATABASE_URL env vars Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
687 B
YAML
32 lines
687 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: gearbox
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: gearbox
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U gearbox"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
app:
|
|
image: gearbox:latest
|
|
environment:
|
|
DATABASE_URL: postgresql://gearbox:${POSTGRES_PASSWORD}@postgres:5432/gearbox
|
|
GEARBOX_URL: ${GEARBOX_URL}
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
volumes:
|
|
- uploads:/app/uploads
|
|
|
|
volumes:
|
|
pgdata:
|
|
uploads:
|