54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-pitopn}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me-strong-password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-pitopn}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-pitopn} -d ${POSTGRES_DB:-pitopn}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 10s
|
|
networks:
|
|
- internal
|
|
|
|
web:
|
|
build: .
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
APP_NAME: ${APP_NAME:-Pitopn}
|
|
SECRET_KEY: ${SECRET_KEY:-change-me-to-a-long-random-string}
|
|
DEBUG: ${DEBUG:-false}
|
|
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-change-me-strong-admin-password}
|
|
POSTGRES_USER: ${POSTGRES_USER:-pitopn}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-change-me-strong-password}
|
|
POSTGRES_DB: ${POSTGRES_DB:-pitopn}
|
|
POSTGRES_HOST: db
|
|
POSTGRES_PORT: 5432
|
|
ports:
|
|
- "${APP_PORT:-8000}:8000"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8000/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 25s
|
|
networks:
|
|
- internal
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
internal:
|
|
driver: bridge
|