Files
don_confiao_backend/docker-compose.staging.yml
aserrador 27b68a9ac2 chore: configuración de infraestructura y dependencias
- docker-compose.staging.yml: env vars a env_file, limpia defaults duplicados
- docker-compose.prod.yml: descomenta y activa servicio nginx
- staging.py: DEBUG=True, POSTGRES_* env vars, logging DEBUG
- pyproject.toml + poetry.lock: agrega pillow y whitenoise
2026-06-22 11:35:47 -05:00

65 lines
1.5 KiB
YAML

services:
postgres:
image: postgres:15-alpine
container_name: tienda_ilusion_postgres_staging
env_file:
- .env.staging
volumes:
- postgres_staging_data:/var/lib/postgresql/data
ports:
- "5433:5432"
networks:
- tienda_staging_network
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${DB_USER:-tienda_ilusion_user} -d ${DB_PASSWORD:-tienda_ilusion_staging}",
]
interval: 10s
timeout: 5s
retries: 5
django:
build:
context: ./
dockerfile: django.Dockerfile
container_name: tienda_ilusion_django_staging
env_file:
- .env.staging
environment:
- DJANGO_ENV=staging
- DB_HOST=postgres
volumes:
- ./tienda_ilusion:/app/
- static_staging_volume:/app/staticfiles
- media_staging_volume:/app/media
- logs_staging_volume:/app/logs
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
networks:
- tienda_staging_network
restart: unless-stopped
command: >
sh -c "python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 4 --timeout 120 --reload"
volumes:
postgres_staging_data:
driver: local
static_staging_volume:
driver: local
media_staging_volume:
driver: local
logs_staging_volume:
driver: local
networks:
tienda_staging_network:
driver: bridge