From ce750c945123bd5784a2985003c251b76372d783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Tue, 2 Apr 2024 18:46:07 +0200 Subject: [PATCH] import docker setup from n8n-io/n8n-docker-caddy --- docker-caddy/.env | 18 +++++++++++++++ docker-caddy/LICENSE | 21 +++++++++++++++++ docker-caddy/README.md | 19 ++++++++++++++++ docker-caddy/caddy_config/.gitkeep | 0 docker-caddy/caddy_config/Caddyfile | 5 +++++ docker-caddy/docker-compose.yml | 35 +++++++++++++++++++++++++++++ docker-caddy/local_files/.gitkeep | 0 7 files changed, 98 insertions(+) create mode 100644 docker-caddy/.env create mode 100644 docker-caddy/LICENSE create mode 100644 docker-caddy/README.md create mode 100644 docker-caddy/caddy_config/.gitkeep create mode 100644 docker-caddy/caddy_config/Caddyfile create mode 100644 docker-caddy/docker-compose.yml create mode 100644 docker-caddy/local_files/.gitkeep diff --git a/docker-caddy/.env b/docker-caddy/.env new file mode 100644 index 0000000..4dbb543 --- /dev/null +++ b/docker-caddy/.env @@ -0,0 +1,18 @@ +# Replace with the path where you created folders earlier +DATA_FOLDER=//n8n-docker-caddy + +# The top level domain to serve from, this should be the same as the subdomain you created above +DOMAIN_NAME=example.com + +# The subdomain to serve from +SUBDOMAIN=n8n + +# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from +# above example would result in: https://n8n.example.com + +# Optional timezone to set which gets used by Cron-Node by default +# If not set New York time will be used +GENERIC_TIMEZONE=Europe/Berlin + +# The email address to use for the SSL certificate creation +SSL_EMAIL=example@example.com diff --git a/docker-caddy/LICENSE b/docker-caddy/LICENSE new file mode 100644 index 0000000..4783546 --- /dev/null +++ b/docker-caddy/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 n8n - Workflow Automation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/docker-caddy/README.md b/docker-caddy/README.md new file mode 100644 index 0000000..40df6ca --- /dev/null +++ b/docker-caddy/README.md @@ -0,0 +1,19 @@ +# n8n-docker-caddy + +Get up and running with n8n on the following platforms: + +* [DigitalOcean tutorial](https://docs.n8n.io/hosting/server-setups/digital-ocean/) +* [Hetzner Cloud tutorial](https://docs.n8n.io/hosting/server-setups/hetzner/) + +If you have questions after trying the tutorials, check out the [forums](https://community.n8n.io/). + +## Prerequisites + +Self-hosting n8n requires technical knowledge, including: + +* Setting up and configuring servers and containers +* Managing application resources and scaling +* Securing servers and applications +* Configuring n8n + +n8n recommends self-hosting for expert users. Mistakes can lead to data loss, security issues, and downtime. If you aren't experienced at managing servers, n8n recommends [n8n Cloud](https://n8n.io/cloud/). diff --git a/docker-caddy/caddy_config/.gitkeep b/docker-caddy/caddy_config/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-caddy/caddy_config/Caddyfile b/docker-caddy/caddy_config/Caddyfile new file mode 100644 index 0000000..6ea45b9 --- /dev/null +++ b/docker-caddy/caddy_config/Caddyfile @@ -0,0 +1,5 @@ +n8n.. { + reverse_proxy n8n:5678 { + flush_interval -1 + } +} diff --git a/docker-caddy/docker-compose.yml b/docker-caddy/docker-compose.yml new file mode 100644 index 0000000..d6d7516 --- /dev/null +++ b/docker-caddy/docker-compose.yml @@ -0,0 +1,35 @@ +version: "3.7" + +services: + caddy: + image: caddy:latest + restart: unless-stopped + ports: + - "80:80" + - "443:443" + volumes: + - caddy_data:/data + - ${DATA_FOLDER}/caddy_config:/config + - ${DATA_FOLDER}/caddy_config/Caddyfile:/etc/caddy/Caddyfile + + n8n: + image: docker.n8n.io/n8nio/n8n + restart: always + ports: + - 5678:5678 + environment: + - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME} + - N8N_PORT=5678 + - N8N_PROTOCOL=https + - NODE_ENV=production + - WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/ + - GENERIC_TIMEZONE=${GENERIC_TIMEZONE} + volumes: + - n8n_data:/home/node/.n8n + - ${DATA_FOLDER}/local_files:/files + +volumes: + caddy_data: + external: true + n8n_data: + external: true diff --git a/docker-caddy/local_files/.gitkeep b/docker-caddy/local_files/.gitkeep new file mode 100644 index 0000000..e69de29