register database with docker compose; add uv & pyproject

This commit is contained in:
2026-04-16 20:18:03 +08:00
parent 4e0df5f13e
commit 4bb768aa33
6 changed files with 553 additions and 3 deletions
+16 -1
View File
@@ -1,12 +1,27 @@
version: "3.8"
services:
db:
image: postgres:18-alpine
environment:
POSTGRES_USER: $SERVICE_USER_POSTGRES
POSTGRES_PASSWORD: $SERVICE_PASSWORD_POSTGRES
POSTGRES_DB: endorphin_db
volumes:
- postgres_data:/var/lib/postgresql/data
app:
build: .
environment:
- DATABASE_URL=${DATABASE_URL}
DATABASE_URL: postgres://$SERVICE_USER_POSTGRES:$SERVICE_PASSWORD_POSTGRES@postgres:5432/endorphin_db
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 3s
retries: 3
depends_on:
postgres:
condition: service_healthy
volumes:
postgres_data: