compose.yaml.backup 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. ---
  2. name: "n8n"
  3. description: "Workflow automation and integration tool"
  4. version: "0.0.1"
  5. date: "2025-09-03"
  6. author: "Christian Lempa"
  7. tags:
  8. - n8n
  9. - automation
  10. - workflows
  11. - compose
  12. variables:
  13. template.custom_config:
  14. description: "Custom configuration for n8n"
  15. hint: "Additional environment variables or settings"
  16. type: "string"
  17. default: ""
  18. ---
  19. services:
  20. {{ service_name }}:
  21. image: n8nio/n8n:1.110.1
  22. environment:
  23. - N8N_LOG_LEVEL={{ container_loglevel | default('info') }}
  24. - GENERIC_TIMEZONE={{ container_timezone }}
  25. - TZ={{ container_timezone }}
  26. - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
  27. - N8N_RUNNERS_ENABLED=true
  28. {% if traefik %}
  29. {% if traefik.tls %}
  30. - N8N_EDITOR_BASE_URL=https://{{ traefik.host }}
  31. {% else %}
  32. - N8N_EDITOR_BASE_URL=http://{{ traefik.host }}
  33. {% endif %}
  34. {% endif %}
  35. {% if postgres %}
  36. - DB_TYPE=postgresdb
  37. - DB_POSTGRESDB_HOST={{ postgres.host }}
  38. - DB_POSTGRESDB_PORT=${DB_POSTGRESDB_PORT:-5432}
  39. - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
  40. - DB_POSTGRESDB_USER=${POSTGRES_USER}
  41. - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
  42. {% endif %}
  43. volumes:
  44. - /etc/localtime:/etc/localtime:ro
  45. - data:/home/node/.n8n
  46. {% if network %}
  47. networks:
  48. - {{ network.name | default('bridge') }}
  49. {% endif %}
  50. {% if traefik %}
  51. labels:
  52. - traefik.enable={{ traefik | default('true') }}
  53. - traefik.http.routers.{{ service_name }}.rule=Host(`{{ traefik.host }}`)
  54. {% if traefik.tls %}
  55. - traefik.http.routers.{{ service_name }}.entrypoints={{ traefik.tls.entrypoint | default('websecure') }}
  56. - traefik.http.routers.{{ service_name }}.tls=true
  57. - traefik.http.routers.{{ service_name }}.tls.certresolver={{ traefik.tls.certresolver }}
  58. {% else %}
  59. - traefik.http.routers.{{ service_name }}.entrypoints={{ traefik.entrypoint | default('web') }}
  60. {% endif %}
  61. - traefik.http.services.{{ service_name }}.loadbalancer.server.port=5678
  62. {% endif %}
  63. restart: {{ restart_policy | default('unless-stopped') }}
  64. {% if ports %}
  65. volumes:
  66. data:
  67. driver: local
  68. {% if network %}
  69. networks:
  70. {{ network.name | default('bridge') }}:
  71. {% if network.external %}
  72. external: true
  73. {% endif %}
  74. {% endif %}
  75. {% endif %}