33 lines
659 B
YAML
33 lines
659 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
api:
|
|
build: .
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://inventario:inventario@db:5432/inventario
|
|
- DEBUG=true
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
environment:
|
|
- POSTGRES_USER=inventario
|
|
- POSTGRES_PASSWORD=inventario
|
|
- POSTGRES_DB=inventario
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
health_check:
|
|
test: ["CMD-SHELL", "pg_isready -U inventario"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|