Add Pitopn digital shop with FastAPI, Postgres 17, and Docker Compose
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
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}
|
||||
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
|
||||
Reference in New Issue
Block a user