- Dockerfile: multi-stage Python 3.12 slim build - docker-compose.yml: app + PostgreSQL 16 with healthcheck - requirements.txt: fastapi, uvicorn, psycopg, passlib, jose - .dockerignore: exclude venv, pycache, secrets - app.py: env-based DB config (DB_HOST/PORT/NAME/USER/PASSWORD) - README: Docker deploy instructions
46 lines
1.0 KiB
YAML
46 lines
1.0 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
app:
|
|
build: .
|
|
container_name: jetour-bi
|
|
ports:
|
|
- "8765:8765"
|
|
environment:
|
|
DB_HOST: db
|
|
DB_PORT: "5432"
|
|
DB_NAME: jetour-bi
|
|
DB_USER: jetour
|
|
DB_PASSWORD: ${DB_PASSWORD:-jetour}
|
|
JWT_SECRET: "${JWT_SECRET:-change-me-in-production}"
|
|
SMTP_HOST: "${SMTP_HOST:-}"
|
|
SMTP_PORT: "${SMTP_PORT:-587}"
|
|
SMTP_USER: "${SMTP_USER:-}"
|
|
SMTP_PASS: "${SMTP_PASS:-}"
|
|
SMTP_FROM: "${SMTP_FROM:-reports@jetour.mu}"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: jetour-db
|
|
environment:
|
|
POSTGRES_USER: jetour
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-jetour}
|
|
POSTGRES_DB: jetour-bi
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- "5433:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U jetour -d jetour-bi"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|