- Add nginx.local.conf for HTTP-only access via local IP - Add docker-compose.local.yml for local network deployment - Simpler setup without SSL certificate requirements Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
160 lines
3.9 KiB
YAML
160 lines
3.9 KiB
YAML
version: '3.8'
|
|
|
|
# ===========================================
|
|
# LOCAL NETWORK - Social Media Automation
|
|
# Acceso por IP local sin SSL
|
|
# Uso: docker-compose -f docker-compose.local.yml up -d
|
|
# ===========================================
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-app
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-social_user}:${POSTGRES_PASSWORD:-social_pass}@db:5432/${POSTGRES_DB:-social_automation}
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app:/app/app
|
|
- ./dashboard:/app/dashboard
|
|
- uploaded_images:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
worker:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-worker
|
|
command: celery -A app.worker.celery_app worker --loglevel=info --concurrency=2
|
|
environment:
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-social_user}:${POSTGRES_PASSWORD:-social_pass}@db:5432/${POSTGRES_DB:-social_automation}
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app:/app/app
|
|
- uploaded_images:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
beat:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-beat
|
|
command: celery -A app.worker.celery_app beat --loglevel=info
|
|
environment:
|
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-social_user}:${POSTGRES_PASSWORD:-social_pass}@db:5432/${POSTGRES_DB:-social_automation}
|
|
- REDIS_URL=redis://redis:6379/0
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./app:/app/app
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_started
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
flower:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: social-automation-flower
|
|
command: celery -A app.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
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: social-automation-db
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:-social_user}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-social_pass}
|
|
- POSTGRES_DB=${POSTGRES_DB:-social_automation}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./backups:/backups
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-social_user}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
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
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: social-automation-nginx
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- ./nginx/nginx.local.conf:/etc/nginx/nginx.conf:ro
|
|
- ./dashboard/static:/usr/share/nginx/html/static:ro
|
|
depends_on:
|
|
- app
|
|
restart: unless-stopped
|
|
networks:
|
|
- social-network
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
uploaded_images:
|
|
|
|
networks:
|
|
social-network:
|
|
driver: bridge
|