Add docker-compose.yml
This commit is contained in:
32
docker-compose.yml
Normal file
32
docker-compose.yml
Normal file
@@ -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:
|
||||
Reference in New Issue
Block a user