45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
services:
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: control_mve_postgres
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
|
|
POSTGRES_DB: ${POSTGRES_DB:-control_mve}
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- app-network
|
|
|
|
api:
|
|
build: .
|
|
container_name: control_mve_api
|
|
command: sh -c "sh /code/migrate.sh && uvicorn app.main:app --host 0.0.0.0 --port 8009 --reload"
|
|
volumes:
|
|
- ./app:/code/app
|
|
- ./alembic:/code/alembic
|
|
- ./alembic.ini:/code/alembic.ini
|
|
ports:
|
|
- "${API_PORT:-8009}:8009"
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
networks:
|
|
- app-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
|
|
networks:
|
|
app-network:
|
|
driver: bridge
|