fix: eliminar Redis y worker locales del docker-compose.yml
- Redis ahora es un Database Resource externo en Coolify Configurar: REDIS_HOST, REDIS_PORT, REDIS_PASSWORD en env vars - Worker corre dentro del contenedor app via Supervisor (no servicio aparte) - Eliminados: servicio redis, worker, redis-commander, volumenes db-data/redis-data - Solo queda: servicio app + volumen php-socket
This commit is contained in:
+5
-96
@@ -22,8 +22,9 @@ services:
|
||||
- DB_NAME=${DB_NAME}
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASS=${DB_PASS}
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
# Redis gestionado por Coolify — configurar REDIS_HOST en env vars de Coolify
|
||||
- REDIS_HOST=${REDIS_HOST:-127.0.0.1}
|
||||
- REDIS_PORT=${REDIS_PORT:-6379}
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
|
||||
- WHATSAPP_TOKEN=${WHATSAPP_TOKEN}
|
||||
- WHATSAPP_PHONE_NUMBER_ID=${WHATSAPP_PHONE_NUMBER_ID}
|
||||
@@ -72,102 +73,10 @@ services:
|
||||
# start_period: 30s
|
||||
# command: --default-authentication-plugin=mysql_native_password --max_connections=500
|
||||
|
||||
# Redis para colas y caché
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: whatsapp-bot-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
command: >
|
||||
redis-server
|
||||
--appendonly yes
|
||||
--maxmemory 512mb
|
||||
--maxmemory-policy allkeys-lru
|
||||
${REDIS_PASSWORD:+--requirepass $REDIS_PASSWORD}
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
networks:
|
||||
- whatsapp-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
|
||||
# Workers dedicados (adicionales a los del contenedor app)
|
||||
worker:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.worker
|
||||
restart: unless-stopped
|
||||
working_dir: /var/www/html
|
||||
deploy:
|
||||
replicas: ${WORKER_REPLICAS:-2}
|
||||
volumes:
|
||||
- ./logs:/var/www/html/logs
|
||||
- ./.env:/var/www/html/.env:ro
|
||||
environment:
|
||||
- APP_ENV=${APP_ENV:-production}
|
||||
- DB_HOST=${DB_HOST}
|
||||
- DB_PORT=${DB_PORT:-3306}
|
||||
- DB_NAME=${DB_NAME}
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASS=${DB_PASS}
|
||||
- REDIS_HOST=redis
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
|
||||
- LOG_LEVEL=${LOG_LEVEL:-DEBUG}
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- whatsapp-network
|
||||
command: php worker.php --daemon
|
||||
|
||||
# PHPMyAdmin (DESHABILITADO - solo si usas MySQL local)
|
||||
# phpmyadmin:
|
||||
# image: phpmyadmin:latest
|
||||
# container_name: whatsapp-bot-phpmyadmin
|
||||
# restart: unless-stopped
|
||||
# ports:
|
||||
# - "${PHPMYADMIN_PORT:-8081}:80"
|
||||
# environment:
|
||||
# PMA_HOST: db
|
||||
# PMA_PORT: 3306
|
||||
# PMA_USER: ${DB_USER:-whatsapp_user}
|
||||
# PMA_PASSWORD: ${DB_PASS}
|
||||
# UPLOAD_LIMIT: 50M
|
||||
# depends_on:
|
||||
# - db
|
||||
# networks:
|
||||
# - whatsapp-network
|
||||
# profiles:
|
||||
# - dev
|
||||
|
||||
# Redis Commander (opcional, solo desarrollo)
|
||||
redis-commander:
|
||||
image: rediscommander/redis-commander:latest
|
||||
container_name: whatsapp-bot-redis-commander
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${REDIS_COMMANDER_PORT:-8082}:8081"
|
||||
environment:
|
||||
- REDIS_HOSTS=local:redis:6379
|
||||
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
|
||||
depends_on:
|
||||
- redis
|
||||
networks:
|
||||
- whatsapp-network
|
||||
profiles:
|
||||
- dev
|
||||
# Redis: gestionado como Database Resource en Coolify (externo)
|
||||
# Worker: corre dentro del contenedor app vía Supervisor
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
driver: local
|
||||
redis-data:
|
||||
driver: local
|
||||
php-socket:
|
||||
driver: local
|
||||
|
||||
|
||||
Reference in New Issue
Block a user