# Development overrides for n8n
# Use with: docker compose -f docker-compose.yml -f docker-compose.n8n.yml -f docker-compose.n8n.override.yml up -d

services:
  # Dev stacks cap restarts and don't come back on their own after a reboot:
  # a project folder deleted or moved while its stack existed otherwise
  # crash-loops forever. Run `vibecarbon up` after a reboot. Prod keeps
  # unless-stopped (this file is never deployed).
  n8n:
    restart: on-failure:5
    labels:
      # Dev: No auth required (same as the traefik dashboard in local dev)
      # Production uses ForwardAuth via docker-compose.n8n.yml labels
      # Empty middlewares override removes ForwardAuth requirement
      - "traefik.enable=true"
      - "traefik.http.routers.n8n.rule=Host(`n8n.localhost`)"
      - "traefik.http.routers.n8n.entrypoints=web"
      - "traefik.http.routers.n8n.middlewares="
      - "traefik.http.services.n8n.loadbalancer.server.port=5678"

  # Dev only (this file is never deployed): the documented dev login is the
  # admin email with the password "changeme". Compose reads "$$" as a literal
  # "$", so the bcrypt hash below is written with every "$" doubled. Without
  # this variable setup.sh stores a random password nobody knows, which is what
  # every production deploy gets.
  n8n-setup:
    environment:
      - N8N_ADMIN_PASSWORD_HASH=$$2a$$10$$HuKPNCaZ0UnhGFhLC1wMZ.e.1dpHzQ4eY84AWxGVTINMGnzDx8awy
