feat: add n8n service configuration with docker and stack files
ci/woodpecker/push/woodpecker Pipeline failed Details

This commit is contained in:
Leopere 2025-04-04 14:04:37 -04:00
parent 9bfa342604
commit 52c441aabd
6 changed files with 46 additions and 19 deletions

View File

@ -1,7 +1,7 @@
# The only stuff that happens here is template gets replaced and so does possibly nixius # This compose file purely exists as a template for production image builds.
services: services:
template: n8n:
build: build:
context: ./docker/template context: ./docker/n8n
dockerfile: Dockerfile.production dockerfile: Dockerfile.production
image: git.nixc.us/nixius/template:production image: git.nixc.us/nixius/n8n:production

View File

@ -1,7 +1,7 @@
# The only stuff that happens here is template gets replaced and so does possibly nixius # This compose file purely exists as a template for staging and caching image builds.
services: services:
template: n8n:
build: build:
context: ./docker/template context: ./docker/n8n
dockerfile: Dockerfile.staging dockerfile: Dockerfile.staging
image: git.nixc.us/colin/template:staging image: git.nixc.us/colin/n8n:staging

2
docker/n8n/Dockerfile Normal file
View File

@ -0,0 +1,2 @@
# This container mostly pulls from the docker hub registry so we don't care about pull limits in production. There should be no need to change this file.
FROM n8nio/n8n:latest

View File

@ -0,0 +1,2 @@
FROM git.nixc.us/nixc/n8n:staging
# This container is mostly intended to be blank but would add production specific changes here if needed only.

View File

@ -3,8 +3,8 @@ networks:
external: true external: true
services: services:
template: n8n:
image: git.nixc.us/nixius/template:production image: git.nixc.us/nixius/n8n:production
deploy: deploy:
replicas: 1 replicas: 1
restart_policy: restart_policy:
@ -22,15 +22,12 @@ services:
- traefik - traefik
labels: labels:
- traefik.enable=true - traefik.enable=true
- traefik.http.routers.production_template.rule=Host(`template.nixc.us`) - traefik.http.routers.production_n8n.rule=Host(`n8n.nixc.us`)
- traefik.http.routers.production_template.entrypoints=websecure - traefik.http.routers.production_n8n.entrypoints=websecure
- traefik.http.routers.production_template.tls=true - traefik.http.routers.production_n8n.tls=true
- traefik.http.routers.production_template.tls.certresolver=letsencryptresolver - traefik.http.routers.production_n8n.tls.certresolver=letsencryptresolver
- traefik.http.services.production_template.loadbalancer.server.port=3000 - traefik.http.services.production_n8n.loadbalancer.server.port=5678
# - traefik.http.services.production_template.loadbalancer.healthcheck.path=/health - traefik.http.routers.production_n8n.middlewares=secure-headers
# - traefik.http.services.production_template.loadbalancer.healthcheck.interval=30s
# - traefik.http.services.production_template.loadbalancer.healthcheck.timeout=5s
- traefik.http.routers.production_template.middlewares=secure-headers
midtownplaydio: midtownplaydio:
image: git.nixc.us/nixius/midtownplaydio:production image: git.nixc.us/nixius/midtownplaydio:production

View File

@ -31,3 +31,29 @@ services:
# - traefik.http.services.staging_template.loadbalancer.healthcheck.path=/health # - traefik.http.services.staging_template.loadbalancer.healthcheck.path=/health
# - traefik.http.services.staging_template.loadbalancer.healthcheck.interval=30s # - traefik.http.services.staging_template.loadbalancer.healthcheck.interval=30s
# - traefik.http.services.staging_template.loadbalancer.healthcheck.timeout=5s # - traefik.http.services.staging_template.loadbalancer.healthcheck.timeout=5s
n8n:
image: git.nixc.us/colin/n8n:staging
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
update_config:
parallelism: 1
delay: 10s
order: start-first
rollback_config:
parallelism: 1
delay: 10s
order: stop-first
networks:
- traefik
labels:
- traefik.enable=true
- traefik.http.routers.staging_n8n.rule=Host(`staging-n8n.nixc.us`)
- traefik.http.routers.staging_n8n.entrypoints=websecure
- traefik.http.routers.staging_n8n.tls=true
- traefik.http.routers.staging_n8n.tls.certresolver=letsencryptresolver
- traefik.http.services.staging_n8n.loadbalancer.server.port=5678
- traefik.http.routers.staging_n8n.middlewares=secure-headers