77 lines
2.1 KiB
Django/Jinja
77 lines
2.1 KiB
Django/Jinja
version: '3'
|
|
|
|
services:
|
|
db:
|
|
image: postgres:14
|
|
restart: always
|
|
container_name: n8n_db
|
|
networks:
|
|
- internal
|
|
volumes:
|
|
- db:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_PASSWORD=n8n
|
|
- POSTGRES_DB=n8n
|
|
- POSTGRES_USER=n8n
|
|
|
|
n8n:
|
|
image: n8nio/n8n
|
|
restart: always
|
|
container_name: n8n
|
|
networks:
|
|
- internal
|
|
- proxy
|
|
volumes:
|
|
- n8n:/home/node/.n8n
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.n8n-secure.entrypoints=https"
|
|
- "traefik.http.routers.n8n-secure.rule=Host(`n8n.{{ server.domain }}`)"
|
|
- "traefik.http.routers.n8n-secure.tls=true"
|
|
- "traefik.http.routers.n8n-secure.tls.certresolver=sslResolver"
|
|
# - "traefik.http.routers.whoami-secure.service=whoami"
|
|
# - "traefik.http.services.whoami.loadbalancer.server.port=9002"
|
|
- "traefik.docker.network=proxy"
|
|
environment:
|
|
- DB_TYPE=postgresdb
|
|
- DB_POSTGRESDB_PORT=5432
|
|
- DB_POSTGRESDB_HOST=db
|
|
- DB_POSTGRESDB_DATABASE=n8n
|
|
- DB_POSTGRESDB_USER=n8n
|
|
- DB_POSTGRESDB_PASSWORD=n8n
|
|
|
|
# BACKUP
|
|
backup_n8n:
|
|
image: offen/docker-volume-backup:latest
|
|
restart: always
|
|
environment:
|
|
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
|
|
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-n8n.tar.gz"
|
|
BACKUP_LATEST_SYMLINK: n8n.latest.tar.gz
|
|
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
|
|
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
|
|
volumes:
|
|
- n8n:/backup:ro
|
|
- {{ server.backup.folder }}/n8n:/archive
|
|
|
|
backup_db:
|
|
image: offen/docker-volume-backup:latest
|
|
restart: always
|
|
environment:
|
|
BACKUP_CRON_EXPRESSION: "{{ server.backup.cron_expression }}"
|
|
BACKUP_FILENAME: "{{ server.backup.filename_date_format }}-db.tar.gz"
|
|
BACKUP_LATEST_SYMLINK: db.latest.tar.gz
|
|
BACKUP_EXCLUDE_REGEXP: "\\.log$$"
|
|
BACKUP_RETENTION_DAYS: "{{ server.backup.retention_days }}"
|
|
volumes:
|
|
- db:/backup:ro
|
|
- {{ server.backup.folder }}/n8n:/archive
|
|
|
|
volumes:
|
|
n8n:
|
|
db:
|
|
|
|
networks:
|
|
internal:
|
|
proxy:
|
|
external: true
|