Spaces:
Running
Running
version: '3.8' | |
services: | |
# Aplicación principal | |
antiscam-ai: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
container_name: antiscam-ai-pro | |
restart: unless-stopped | |
ports: | |
- "7860:7860" | |
environment: | |
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY} | |
- STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY} | |
- EMAIL_USER=${EMAIL_USER} | |
- EMAIL_PASSWORD=${EMAIL_PASSWORD} | |
- DATABASE_URL=postgresql://antiscam:${DB_PASSWORD}@postgres:5432/antiscam_db | |
volumes: | |
- ./uploads:/app/uploads | |
- ./logs:/app/logs | |
- antiscam_data:/app/data | |
depends_on: | |
- postgres | |
- redis | |
networks: | |
- antiscam-network | |
healthcheck: | |
test: ["CMD", "curl", "-f", "http://localhost:7860/"] | |
interval: 30s | |
timeout: 10s | |
retries: 3 | |
start_period: 40s | |
# Base de datos PostgreSQL | |
postgres: | |
image: postgres:15-alpine | |
container_name: antiscam-postgres | |
restart: unless-stopped | |
environment: | |
- POSTGRES_DB=antiscam_db | |
- POSTGRES_USER=antiscam | |
- POSTGRES_PASSWORD=${DB_PASSWORD} | |
volumes: | |
- postgres_data:/var/lib/postgresql/data | |
- ./init.sql:/docker-entrypoint-initdb.d/init.sql | |
networks: | |
- antiscam-network | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U antiscam"] | |
interval: 10s | |
timeout: 5s | |
retries: 5 | |
# Redis para cache y sesiones | |
redis: | |
image: redis:7-alpine | |
container_name: antiscam-redis | |
restart: unless-stopped | |
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD} | |
volumes: | |
- redis_data:/data | |
networks: | |
- antiscam-network | |
healthcheck: | |
test: ["CMD", "redis-cli", "--raw", "incr", "ping"] | |
interval: 10s | |
timeout: 3s | |
retries: 5 | |
# Nginx como proxy reverso | |
nginx: | |
image: nginx:alpine | |
container_name: antiscam-nginx | |
restart: unless-stopped | |
ports: | |
- "80:80" | |
- "443:443" | |
volumes: | |
- ./nginx/nginx.conf:/etc/nginx/nginx.conf | |
- ./nginx/ssl:/etc/nginx/ssl | |
- ./nginx/logs:/var/log/nginx | |
depends_on: | |
- antiscam-ai | |
networks: | |
- antiscam-network | |
# Monitoring con Prometheus (opcional) | |
prometheus: | |
image: prom/prometheus:latest | |
container_name: antiscam-prometheus | |
restart: unless-stopped | |
ports: | |
- "9090:9090" | |
volumes: | |
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml | |
- prometheus_data:/prometheus | |
networks: | |
- antiscam-network | |
profiles: | |
- monitoring | |
# Grafana para dashboards (opcional) | |
grafana: | |
image: grafana/grafana:latest | |
container_name: antiscam-grafana | |
restart: unless-stopped | |
ports: | |
- "3000:3000" | |
environment: | |
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} | |
volumes: | |
- grafana_data:/var/lib/grafana | |
- ./monitoring/grafana:/etc/grafana/provisioning | |
networks: | |
- antiscam-network | |
profiles: | |
- monitoring | |
# Volúmenes persistentes | |
volumes: | |
postgres_data: | |
driver: local | |
redis_data: | |
driver: local | |
prometheus_data: | |
driver: local | |
grafana_data: | |
driver: local | |
antiscam_data: | |
driver: local | |
# Red interna | |
networks: | |
antiscam-network: | |
driver: bridge |