-
Notifications
You must be signed in to change notification settings - Fork 608
Codex/improve heroku deployment code for n8n qab2dj #28
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
Open
kuromi04
wants to merge
15
commits into
n8n-io:main
Choose a base branch
from
kuromi04:codex/improve-heroku-deployment-code-for-n8n-qab2dj
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+335
−74
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7262673
Update PostgreSQL version to 15 in app.json
kuromi04 34ace78
Merge pull request #1 from kuromi04/kuromi04-patch-1
kuromi04 8005517
Update repository URL in app.json
kuromi04 09dbac1
Merge pull request #2 from kuromi04/kuromi04-patch-2
kuromi04 e1cd4e0
Update Heroku deploy button link in README
kuromi04 7a90229
Fix deploy button link in README.md
kuromi04 a100791
Update repository URL in app.json
kuromi04 324f696
Merge pull request #4 from kuromi04/kuromi04-patch-4
kuromi04 f12200f
Improve runtime n8n upgrade flow
kuromi04 31dca5a
Ensure deploys refresh n8n and add manual update option
kuromi04 e5635e2
Harden runtime upgrades for n8n
kuromi04 1576d5c
Limpiar la caché de npm en reinstalaciones forzadas de n8n
kuromi04 40e3adb
Declarar la imagen de release para Heroku
kuromi04 5e86d30
Ordenar la definición de variables en el Dockerfile
kuromi04 d822a03
Alinear la fase de release con el entrypoint del contenedor
kuromi04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,18 @@ | ||
| FROM n8nio/n8n:latest | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| ARG N8N_VERSION=latest | ||
| FROM n8nio/n8n:${N8N_VERSION} | ||
|
|
||
| # Run as root to allow runtime updates of the n8n CLI when requested. | ||
| USER root | ||
|
|
||
| WORKDIR /home/node/packages/cli | ||
| ENTRYPOINT [] | ||
| # Replace the entrypoint with a Heroku-friendly bootstrap script that | ||
| # prepares the database configuration and optionally keeps n8n updated. | ||
| COPY entrypoint.sh /docker-entrypoint.sh | ||
| RUN chmod +x /docker-entrypoint.sh | ||
|
|
||
| ENV N8N_RUNTIME_DIR=/tmp/n8n-runtime | ||
|
|
||
| ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
|
||
| COPY ./entrypoint.sh / | ||
| RUN chmod +x /entrypoint.sh | ||
| CMD ["/entrypoint.sh"] | ||
| CMD ["n8n", "start"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,29 @@ | ||
| # n8n-heroku | ||
|
|
||
| [](https://dashboard.heroku.com/new?template=https://github.com/n8n-io/n8n-heroku/tree/main) | ||
| [](https://dashboard.heroku.com/new?template=https://github.com/kuromi04/n8n-heroku2025.git) | ||
| [](https://dashboard.heroku.com/new?template=https://github.com/kuromi04/n8n-heroku2025.git&env[N8N_FORCE_INSTALL]=true) | ||
|
|
||
| ## 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. | ||
| - To force an upgrade of the currently requested version (for example after a new `latest` is published), set `N8N_FORCE_INSTALL=true` or use the **Actualizar n8n** button above and select your existing application in the Heroku dialog. The flag will trigger a clean reinstall on the next deploy without touching other configuration and clears npm's cache to make sure the newest build is fetched. | ||
|
|
||
| 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. | ||
|
|
||
| Updated releases are placed in a writable runtime directory (default `/tmp/n8n-runtime`) and prepended to the `PATH`, so the Heroku slug remains untouched. The runtime installer automatically clears any previously staged binaries before installing the requested version. You can change the directory by defining the optional `N8N_RUNTIME_DIR` config var as long as the location is writable at boot time. | ||
|
|
||
| Tanto la fase de *release* como los *dynos* web reutilizan el mismo entrypoint del contenedor, por lo que cada despliegue verifica si hay una versión más reciente de n8n, la instala antes de ejecutar las migraciones de base de datos y sólo entonces expone la aplicación. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,43 +1,59 @@ | ||
| { | ||
| "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" | ||
| } | ||
| "name": "n8n", | ||
| "description": "Deploy n8n to Heroku without any hassle", | ||
| "keywords": [ | ||
| "n8n", | ||
| "node", | ||
| "automation" | ||
| ], | ||
| "website": "https://n8n.io", | ||
| "repository": "https://github.com/kuromi04/n8n-heroku2025.git", | ||
| "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" | ||
| "N8N_VERSION": { | ||
| "description": "Desired n8n release (for example 1.42.0). Leave as 'latest' to automatically install the newest stable version during deploy.", | ||
| "value": "latest" | ||
| }, | ||
| "N8N_AUTO_UPDATE": { | ||
| "description": "Set to 'false' to disable automatic updates when the running version differs from N8N_VERSION.", | ||
| "value": "true" | ||
| }, | ||
| "N8N_RUNTIME_DIR": { | ||
| "description": "Optional writable directory for storing on-boot n8n upgrades. Defaults to /tmp/n8n-runtime.", | ||
| "value": "/tmp/n8n-runtime" | ||
| }, | ||
| "N8N_FORCE_INSTALL": { | ||
| "description": "Temporarily set to 'true' to reinstall the requested n8n version from scratch on the next deploy without touching other settings. npm's cache will be cleared automatically to fetch the newest build.", | ||
| "value": "false" | ||
| } | ||
| }, | ||
| "addons": [ | ||
| { | ||
| "plan": "heroku-postgresql", | ||
| "options": { | ||
| "version": "15" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "plan": "papertrail:choklad" | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Deploy Buttons Point to Wrong Repository
The
repositoryfield inapp.jsonand the deploy buttons inREADME.mdnow point to a personal fork (kuromi04/n8n-heroku2025.git) instead of the officialn8n-io/n8n-herokurepository. This appears to be an accidental commit, which could direct users to an unofficial deployment.Additional Locations (1)
app.json#L9-L10