networks:
web-app:
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
networks:
- web-app
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
app:
build: .
depends_on:
db:
condition: service_healthy
ports:
- 8000:8000
environment:
AUTH_SECRET: <secret>
AUTH_URL: http://localhost:3000
DB_USER: postgres
DB_PASSWORD: postgres
DB_URL: postgresql://postgres:postgres@localhost:5432/postgres
networks:
- web-app
networks:
web-app:
services:
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
networks:
- web-app
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
app:
build: .
depends_on:
db:
condition: service_healthy
ports:
- 8000:8000
environment:
AUTH_SECRET: <secret>
AUTH_URL: http://localhost:3000
DB_USER: postgres
DB_PASSWORD: postgres
DB_URL: postgresql://postgres:postgres@localhost:5432/postgres
networks:
- web-app