Adds .env.example as a template and .gitignore to exclude the actual .env file, preventing accidental credential commits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
32 lines
805 B
YAML
32 lines
805 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER:-pamietnik}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:?DB_PASSWORD is required}
|
|
POSTGRES_DB: ${DB_NAME:-pamietnik}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-pamietnik}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "9050:8080"
|
|
environment:
|
|
DATABASE_URL: postgres://${DB_USER:-pamietnik}:${DB_PASSWORD:?DB_PASSWORD is required}@postgres:5432/${DB_NAME:-pamietnik}?sslmode=disable
|
|
LISTEN_ADDR: :8080
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|