services:
  n8n:
    image: n8nio/n8n:2.4.5
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - icontainer-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:5678
    volumes:
      - ./data:/home/node/.n8n
    environment:
      N8N_SECURE_COOKIE: ${N8N_SECURE_COOKIE:-true}
      GENERIC_TIMEZONE: ${TZ:-America/Sao_Paulo}
      TZ: ${TZ:-America/Sao_Paulo}
      N8N_DEFAULT_LOCALE: ${LOCALE:-pt-BR}
      N8N_METRICS: ${HAS_METRICS:-false}
      WEBHOOK_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN}
      N8N_PROTOCOL: ${APP_PROTOCOL:-http}
      N8N_WEBHOOK_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN}/
      N8N_EDITOR_BASE_URL: ${APP_PROTOCOL:-http}://${APP_DOMAIN}/
      N8N_BLOCK_ENV_ACCESS_IN_NODE: ${ACCESS_IN_NODE}
      N8N_SKIP_AUTH_ON_OAUTH_CALLBACK: ${SKIP_AUTH_OAUTH_CALLBACK}
    labels:
      createdBy: "icontainer"
networks:
  icontainer-network:
    external: true