45 lines
922 B
YAML
45 lines
922 B
YAML
services:
|
|
api:
|
|
build:
|
|
context: ..
|
|
dockerfile: backend/Dockerfile
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "23222:8000"
|
|
command:
|
|
[
|
|
"sh",
|
|
"-c",
|
|
"alembic upgrade head && exec uvicorn app.main:app --host 0.0.0.0 --port 8000",
|
|
]
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD",
|
|
"python",
|
|
"-c",
|
|
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz',timeout=2).read()",
|
|
]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 10s
|
|
volumes:
|
|
- ../data:/app/data
|
|
restart: unless-stopped
|
|
|
|
worker:
|
|
build:
|
|
context: ..
|
|
dockerfile: backend/Dockerfile
|
|
env_file:
|
|
- .env
|
|
command: ["python", "-m", "app.worker"]
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ../data:/app/data
|
|
restart: unless-stopped
|