app.polisplexity.tech/docker-compose.yml
Ekaropolus 438fd1c313
All checks were successful
continuous-integration/drone/push Build is passing
Adjust the number of workers
2025-09-18 19:47:42 -06:00

46 lines
1.1 KiB
YAML

version: "3.8"
services:
db:
image: postgres:15
container_name: polisplexity_postgres
restart: always
ports:
- "5434:5432"
volumes:
- pgdata:/var/lib/postgresql/data
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
timeout: 5s
web:
build: .
container_name: polisplexity_django
restart: always
depends_on:
db:
condition: service_healthy
ports:
- "8010:8002"
env_file:
- .env
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn polisplexity.wsgi:application --bind 0.0.0.0:8002 --workers=4 --timeout=180"
volumes:
- static_data:/app/static
- media_data:/app/media
- ./staticfiles:/app/staticfiles
- ./data:/app/polisplexity/data:ro
# - .:/app # ←❌ No lo uses en producción: desactiva para evitar sobrescribir
volumes:
pgdata:
static_data:
media_data: