| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- ---
- name: "n8n"
- description: "Workflow automation and integration tool"
- version: "0.0.1"
- date: "2025-09-03"
- author: "Christian Lempa"
- tags:
- - n8n
- - automation
- - workflows
- - compose
- variables:
- ports.http:
- description: "Port for HTTP access to n8n"
- default: "5678"
- ---
- services:
- {{ service_name }}:
- image: n8nio/n8n:1.110.1
- environment:
- - N8N_LOG_LEVEL={{ container_loglevel | default('info') }}
- - GENERIC_TIMEZONE={{ container_timezone }}
- - TZ={{ container_timezone }}
- - N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- - N8N_RUNNERS_ENABLED=true
- {% if traefik %}
- {% if traefik.tls %}
- - N8N_EDITOR_BASE_URL=https://{{ traefik.host }}
- {% else %}
- - N8N_EDITOR_BASE_URL=http://{{ traefik.host }}
- {% endif %}
- {% endif %}
- {% if postgres %}
- - DB_TYPE=postgresdb
- - DB_POSTGRESDB_HOST={{ postgres.host }}
- - DB_POSTGRESDB_PORT=${DB_POSTGRESDB_PORT:-5432}
- - DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- - DB_POSTGRESDB_USER=${POSTGRES_USER}
- - DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
- {% endif %}
- volumes:
- - /etc/localtime:/etc/localtime:ro
- - data:/home/node/.n8n
- {% if network %}
- networks:
- - {{ network_name | default('bridge') }}
- {% endif %}
- {% if traefik %}
- labels:
- - traefik.enable={{ traefik | default('true') }}
- - traefik.http.routers.{{ service_name }}.rule=Host(`{{ traefik.host }}`)
- {% if traefik.tls %}
- - traefik.http.routers.{{ service_name }}.entrypoints={{ traefik.tls.entrypoint | default('websecure') }}
- - traefik.http.routers.{{ service_name }}.tls=true
- - traefik.http.routers.{{ service_name }}.tls.certresolver={{ traefik.tls.certresolver }}
- {% else %}
- - traefik.http.routers.{{ service_name }}.entrypoints={{ traefik.entrypoint | default('web') }}
- {% endif %}
- - traefik.http.services.{{ service_name }}.loadbalancer.server.port=5678
- {% endif %}
- restart: {{ restart_policy | default('unless-stopped') }}
- {% if ports %}
- ports:
- - "{{ ports.http | default('5678') }}:5678"
- {% endif %}
- volumes:
- data:
- driver: local
- {% if network %}
- networks:
- {{ network_name | default('bridge') }}:
- {% if network_external %}
- external: true
- {% endif %}
- {% endif %}
|