42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
|
|
services:
|
||
|
|
db:
|
||
|
|
image: postgres:15-alpine
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
POSTGRES_USER: gartenmanager
|
||
|
|
POSTGRES_PASSWORD: dev_password
|
||
|
|
POSTGRES_DB: gartenmanager
|
||
|
|
ports:
|
||
|
|
- "5432:5432"
|
||
|
|
volumes:
|
||
|
|
- postgres_dev_data:/var/lib/postgresql/data
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U gartenmanager -d gartenmanager"]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
|
||
|
|
backend:
|
||
|
|
build:
|
||
|
|
context: ./backend
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
restart: unless-stopped
|
||
|
|
environment:
|
||
|
|
DATABASE_URL: postgresql+asyncpg://gartenmanager:dev_password@db:5432/gartenmanager
|
||
|
|
SECRET_KEY: dev_secret_key_not_for_production
|
||
|
|
CORS_ORIGINS: '["http://localhost:5173", "http://localhost:80"]'
|
||
|
|
ports:
|
||
|
|
- "8000:8000"
|
||
|
|
volumes:
|
||
|
|
- ./backend:/app
|
||
|
|
depends_on:
|
||
|
|
db:
|
||
|
|
condition: service_healthy
|
||
|
|
command: >
|
||
|
|
sh -c "alembic upgrade head &&
|
||
|
|
python -m app.seeds.initial_data &&
|
||
|
|
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
postgres_dev_data:
|