- Fix YAML files with unquoted strings containing quotes - Export singleton instances in ai/__init__.py - Fix validator scoring prompt to use replace() instead of format() to avoid conflicts with JSON curly braces Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
163 lines
4.2 KiB
YAML
163 lines
4.2 KiB
YAML
services:
|
|
# ===========================================
|
|
# APLICACIÓN PRINCIPAL (FastAPI)
|
|
# ===========================================
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-app
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://social_user:social_pass@db:5432/social_automation
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app:/app/app
|
|
- ./dashboard:/app/dashboard
|
|
- ./templates:/app/templates
|
|
- ./data:/app/data
|
|
- uploaded_images:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
# ===========================================
|
|
# CELERY WORKER (Procesamiento de tareas)
|
|
# ===========================================
|
|
worker:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-worker
|
|
command: celery -A worker.celery_app worker --loglevel=info --concurrency=2
|
|
environment:
|
|
- DATABASE_URL=postgresql://social_user:social_pass@db:5432/social_automation
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app:/app/app
|
|
- ./worker:/app/worker
|
|
- ./templates:/app/templates
|
|
- uploaded_images:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
# ===========================================
|
|
# CELERY BEAT (Programador de tareas)
|
|
# ===========================================
|
|
beat:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-beat
|
|
command: celery -A worker.celery_app beat --loglevel=info
|
|
environment:
|
|
- DATABASE_URL=postgresql://social_user:social_pass@db:5432/social_automation
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./worker:/app/worker
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
# ===========================================
|
|
# FLOWER (Monitor de Celery)
|
|
# ===========================================
|
|
flower:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-flower
|
|
command: celery -A worker.celery_app flower --port=5555
|
|
ports:
|
|
- "5555:5555"
|
|
environment:
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
- redis
|
|
- worker
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
# ===========================================
|
|
# POSTGRESQL (Base de datos)
|
|
# ===========================================
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: social-automation-db
|
|
environment:
|
|
- POSTGRES_USER=social_user
|
|
- POSTGRES_PASSWORD=social_pass
|
|
- POSTGRES_DB=social_automation
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./scripts/init_db.sql:/docker-entrypoint-initdb.d/init.sql
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U social_user -d social_automation"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
# ===========================================
|
|
# REDIS (Cola de mensajes)
|
|
# ===========================================
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: social-automation-redis
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "6379:6379"
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
# ===========================================
|
|
# VOLÚMENES
|
|
# ===========================================
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
redis_data:
|
|
driver: local
|
|
uploaded_images:
|
|
driver: local
|
|
|
|
# ===========================================
|
|
# REDES
|
|
# ===========================================
|
|
networks:
|
|
social-network:
|
|
driver: bridge
|