37 lines
841 B
YAML
37 lines
841 B
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: fleet
|
|
POSTGRES_PASSWORD: fleet
|
|
POSTGRES_DB: fleet
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U fleet"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
build:
|
|
context: ../backend
|
|
dockerfile: ../docker/Dockerfile.backend
|
|
restart: unless-stopped
|
|
env_file: ../.env
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://fleet:fleet@db:5432/fleet
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ../backend:/app
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
|
|
|
volumes:
|
|
postgres_data:
|