diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..013779b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +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: