-
Notifications
You must be signed in to change notification settings - Fork 613
nwe #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
nwe #26
Changes from 26 commits
7262673
34ace78
8005517
09dbac1
e1cd4e0
7a90229
a100791
324f696
f43879c
79c12e2
81108f3
d0bf903
e144831
cd055ab
30eda5d
8fe510c
81229f3
5a70539
9717e89
3eb27b7
ac93b6e
93c692d
c27911a
61c3d40
0217420
18457e3
49402af
3630ac4
0077428
314d841
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,8 @@ | ||
| # Dockerfile | ||
| FROM n8nio/n8n:latest | ||
|
|
||
| USER root | ||
|
|
||
| WORKDIR /home/node/packages/cli | ||
| ENTRYPOINT [] | ||
|
|
||
| COPY ./entrypoint.sh / | ||
| ENV N8N_HOST=0.0.0.0 | ||
| ENV N8N_PORT=8080 | ||
| EXPOSE 8080 | ||
| COPY entrypoint.sh /entrypoint.sh | ||
| RUN chmod +x /entrypoint.sh | ||
| CMD ["/entrypoint.sh"] | ||
| CMD ["/entrypoint.sh"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,26 @@ | ||
| # n8n-heroku | ||
|
|
||
| [](https://dashboard.heroku.com/new?template=https://github.com/n8n-io/n8n-heroku/tree/main) | ||
| [](https://heroku.com/deploy?template=https://github.com/kuromi04/n8n-heroku2025) | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ## n8n - Free and open fair-code licensed node based Workflow Automation Tool. | ||
|
|
||
| This is a [Heroku](https://heroku.com/)-focused container implementation of [n8n](https://n8n.io/). | ||
|
|
||
| Use the **Deploy to Heroku** button above to launch n8n on Heroku. When deploying, make sure to check all configuration options and adjust them to your needs. It's especially important to set `N8N_ENCRYPTION_KEY` to a random secure value. | ||
| Use the **Deploy to Heroku** button above to launch n8n on Heroku. When deploying, make sure to check all configuration options | ||
| and adjust them to your needs. It's especially important to set `N8N_ENCRYPTION_KEY` to a random secure value. | ||
|
|
||
| Refer to the [Heroku n8n tutorial](https://docs.n8n.io/hosting/server-setups/heroku/) for more information. | ||
|
|
||
| If you have questions after trying the tutorials, check out the [forums](https://community.n8n.io/). | ||
|
|
||
| ## Automatic n8n version management | ||
|
|
||
| This container keeps the n8n CLI up to date without requiring code changes: | ||
|
|
||
| - Set the `N8N_VERSION` config var to pin a specific n8n release. The default value (`latest`) resolves to the newest stable version on each deploy or dyno restart. | ||
| - Automatic upgrades can be disabled by setting `N8N_AUTO_UPDATE=false` if you prefer to manage updates manually. | ||
|
|
||
| During startup the entrypoint script compares the installed version with the desired one and installs upgrades when required, ensuring that only n8n itself changes while the rest of the environment remains stable. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,25 @@ | ||
| { | ||
| "name": "n8n", | ||
| "description": "deploy n8n to heroku without any hassle", | ||
| "keywords": [ | ||
| "n8n", | ||
| "node", | ||
| "automation" | ||
| ], | ||
| "website": "https://n8n.io", | ||
| "repository": "https://github.com/n8n-io/n8n-heroku", | ||
| "logo": "https://raw.githubusercontent.com/n8n-io/n8n-heroku/main/n8n_logo.png", | ||
| "success_url": "/", | ||
| "stack": "container", | ||
| "env": { | ||
| "GENERIC_TIMEZONE": { | ||
| "description": "Time Zone to use with Heroku. You can find the name of your timezone for example here: https://momentjs.com/timezone/.", | ||
| "value": "Europe/Berlin" | ||
| }, | ||
| "N8N_ENCRYPTION_KEY": { | ||
| "description": "Set the n8n encryption key to a static value to avoid Heroku overriding it (causing authentication to fail).", | ||
| "value": "change-me-to-something-else" | ||
| }, | ||
| "WEBHOOK_URL": { | ||
| "description": "Replace <appname> with your Heroku application name. This will ensure the correct webhook URLs are being shown in n8n.", | ||
| "value": "https://<appname>.herokuapp.com" | ||
| }, | ||
| "DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED": { | ||
| "description": "SSL is required to connect to Postgres on Heroku", | ||
| "value": "false" | ||
| } | ||
| }, | ||
| "addons": [ | ||
| { | ||
| "plan": "heroku-postgresql", | ||
| "options": { | ||
| "version": "14" | ||
| } | ||
| }, | ||
| { | ||
| "plan": "papertrail:choklad" | ||
| } | ||
| ] | ||
| } | ||
| "name": "n8n on Heroku", | ||
| "description": "Instala n8n en Heroku con despliegue 1-click y actualizaciones simples", | ||
| "stack": "container", | ||
| "env": { | ||
| "N8N_BASIC_AUTH_ACTIVE": { "value": "true" }, | ||
| "N8N_BASIC_AUTH_USER": { "description": "Usuario para acceder a n8n", "value": "admin" }, | ||
| "N8N_BASIC_AUTH_PASSWORD": { "description": "Contraseña para n8n", "value": "changeme" }, | ||
| "N8N_ENCRYPTION_KEY": { "description": "Clave de cifrado segura", "value": "use-uuid-generator" }, | ||
| "N8N_PORT": { "value": "8080" } | ||
| }, | ||
| "addons": [ | ||
| { "plan": "heroku-postgresql: Essential-0" } | ||
|
||
| ], | ||
|
||
| "build": { | ||
| "docker": { | ||
| "web": "Dockerfile" | ||
| } | ||
| }, | ||
| "run": { | ||
| "web": "/entrypoint.sh" | ||
| }, | ||
| "keywords": ["n8n", "heroku", "automation"] | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,10 @@ | ||
| #!/bin/sh | ||
|
|
||
| # check if port variable is set or go with default | ||
| if [ -z ${PORT+x} ]; then echo "PORT variable not defined, leaving N8N to default port."; else export N8N_PORT="$PORT"; echo "N8N will start on '$PORT'"; fi | ||
|
|
||
| # regex function | ||
| parse_url() { | ||
| eval $(echo "$1" | sed -e "s#^\(\(.*\)://\)\?\(\([^:@]*\)\(:\(.*\)\)\?@\)\?\([^/?]*\)\(/\(.*\)\)\?#${PREFIX:-URL_}SCHEME='\2' ${PREFIX:-URL_}USER='\4' ${PREFIX:-URL_}PASSWORD='\6' ${PREFIX:-URL_}HOSTPORT='\7' ${PREFIX:-URL_}DATABASE='\9'#") | ||
| } | ||
|
|
||
| # prefix variables to avoid conflicts and run parse url function on arg url | ||
| PREFIX="N8N_DB_" parse_url "$DATABASE_URL" | ||
| echo "$N8N_DB_SCHEME://$N8N_DB_USER:$N8N_DB_PASSWORD@$N8N_DB_HOSTPORT/$N8N_DB_DATABASE" | ||
| # Separate host and port | ||
| N8N_DB_HOST="$(echo $N8N_DB_HOSTPORT | sed -e 's,:.*,,g')" | ||
| N8N_DB_PORT="$(echo $N8N_DB_HOSTPORT | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')" | ||
|
|
||
| export DB_TYPE=postgresdb | ||
| export DB_POSTGRESDB_HOST=$N8N_DB_HOST | ||
| export DB_POSTGRESDB_PORT=$N8N_DB_PORT | ||
| export DB_POSTGRESDB_DATABASE=$N8N_DB_DATABASE | ||
| export DB_POSTGRESDB_USER=$N8N_DB_USER | ||
| export DB_POSTGRESDB_PASSWORD=$N8N_DB_PASSWORD | ||
|
|
||
| # kickstart nodemation | ||
| n8n | ||
| # entrypoint.sh | ||
| #!/usr/bin/env bash | ||
| set -e | ||
| : "${WEBHOOK_URL:=https://${HEROKU_APP_NAME}.herokuapp.com/}" | ||
| export WEBHOOK_URL | ||
|
||
| if [ -n "$DATABASE_URL" ]; then | ||
| export DB_TYPE=postgresdb | ||
| export DB_POSTGRESDB_CONNECTION_STRING="$DATABASE_URL" | ||
| fi | ||
| exec n8n start | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| # heroku.yml | ||
| setup: | ||
| addons: | ||
| - plan: heroku-postgresql | ||
| as: DATABASE | ||
|
|
||
| addons: | ||
| - plan: heroku-postgresql:mini | ||
| build: | ||
| docker: | ||
| web: Dockerfile | ||
| docker: | ||
| web: Dockerfile | ||
| run: | ||
| web: /entrypoint.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Heroku Port Conflict with Dockerfile
Hardcoding
N8N_PORT=8080in the Dockerfile conflicts with Heroku's dynamicPORTassignment. This prevents the application from binding to the correct port and starting successfully on Heroku, as the entrypoint script no longer respects Heroku'sPORTvariable.