version: "3.9"

services:
  n8n:
    image: n8nio/n8n
    container_name: n8n-gruposollers
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=admin123
      - N8N_HOST=n8n.gruposollers.com
      - N8N_PORT=5678
      - WEBHOOK_URL=https://n8n.gruposollers.com/
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=web"
      - "traefik.http.routers.n8n.rule=Host(`n8n.gruposollers.com`)"
      - "traefik.http.routers.n8n.entrypoints=websecure"
      - "traefik.http.routers.n8n.tls=true"
      - "traefik.http.routers.n8n.tls.certresolver=myresolver"
      - "traefik.http.services.n8n.loadbalancer.server.port=5678"
    volumes:
      - ./n8n_data:/home/node/.n8n
    networks:
      - web
    restart: unless-stopped

networks:
  web:
    external: true