-
Notifications
You must be signed in to change notification settings - Fork 24
Added n8n to samples #474
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
Added n8n to samples #474
Conversation
samples/n8n/compose.yml
Outdated
| file: compose.dev.yaml | ||
| service: postgres | ||
|
|
||
| n8n: |
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.
@KevyVo you referenced the external storage docs in the PR description, but I don't see it used here.
I'd recommend adding those env vars in here and then documenting any additional steps. Tigris Data is a free option we can point people to that offers s3-compatible storage.
samples/n8n/README.md
Outdated
|
|
||
| [](ASK RAPH) | ||
|
|
||
| This sample shows how to get a [n8n](https://n8n.io/) app up using PostgreSQL as a database and running with Defang. The original sample can be found [here](https://github.com/n8n-io/n8n-hosting/tree/main/docker-compose/withPostgres). The official n8n guide for setting up with PostgreSQL [here](https://docs.n8n.io/hosting/installation/server-setups/docker-compose/) does not work with Defang. To use the version compatible with Defang, please refer to this sample instead. |
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.
If we say it's not compatible with Defang, I think we should highlight why/what isn't compatible.
samples/n8n/README.md
Outdated
|
|
||
| ## Development | ||
|
|
||
| **IMPORTANT:** But before you do that change the default users and passwords in the [`.env`](.env) file! |
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.
One awkward thing is that any .env file we put here will be loaded when we run defang compose up because the docker SDK will pick it up. Config vals should override them but I believe they won't be marked as missing if the .env file exists. I'd recommend hard-coding in the development compose file for that reason.
|
I personally prefer if |
We had so many conversations about this and I used to push that idea, but we collectively agreed a long time ago that that was exactly what we wanted to avoid because it means passing an extra |
|
DISREGARD - Email autoresponder went wacky
…----------
Hey Kevin,
Thanks for the mention. For the env vars in deploy.yaml, you can put them
in the env section of the n8n service. For 1-click deploy, I'll help set
that up once the PR is merged.
Best,
Raphaël
Raphaël Titsworth-Morin (he/him)
Co-Founder | Éphémère Creative Ltd
https://ephemerecreative.ca
Let's build something good together.
On Mon, Oct 6, 2025 at 10:25 AM ***@***.*** wrote:
By popular require, n8n <https://n8n.io/> is added to the list of
samples. Since we do not support volumes right now, all the volumes in the
compose.dev.yaml will be used for only local development.
Only two small items I help from @raphaeltm <https://github.com/raphaeltm>
is to setup 1click deploy and set the env var in the deploy.yaml. I am
unsure which environment to put it in.
Here are some resources I used while developing this:
-
https://github.com/n8n-io/n8n-hosting/tree/main/docker-compose/withPostgres
- https://docs.n8n.io/hosting/configuration/environment-variables/
-
https://docs.n8n.io/hosting/installation/server-setups/docker-compose/
- https://community.n8n.io/t/error-while-deploying-n8n-docker/77926
-
https://community.n8n.io/t/how-to-change-localhost-5678-from-webhook-url/27033/8
Samples Checklist
✅ All good!
------------------------------
You can view, comment on, or merge this pull request online at:
#474
Commit Summary
- 0f0ce0c
<0f0ce0c>
Added n8n to samples
- 1695094
<1695094>
Working n8n with Oauth
- 2d4a465
<2d4a465>
update reason for volumes
- b75f139
<b75f139>
Managed Postgres
- ffe0977
<ffe0977>
n8n Public DNS
- eb14aa0
<eb14aa0>
fix gcp setup deployment
File Changes
(6 files <https://github.com/DefangLabs/samples/pull/474/files>)
- *A* samples/n8n/.github/workflows/deploy.yaml
<https://github.com/DefangLabs/samples/pull/474/files#diff-3c5ddcabafecc6bf328a15063126c1c85f63143c97c67023d5fd425c83c27ea3>
(28)
- *A* samples/n8n/README.md
<https://github.com/DefangLabs/samples/pull/474/files#diff-9468dc59215e010047102e5611169576d935d96c5c64d9d0dddaf9d8b3f09a33>
(94)
- *A* samples/n8n/compose.dev.yaml
<https://github.com/DefangLabs/samples/pull/474/files#diff-b26b523e92e4d6b3f3c579cfd78fc2e974bbb63738241dc8be6a466c96f37bff>
(40)
- *A* samples/n8n/compose.yaml
<https://github.com/DefangLabs/samples/pull/474/files#diff-c9e4bfd0cd96adb39bea69969645d51d6df017e1e9ccf4bf568eb42e3a2e40cd>
(64)
- *A* samples/n8n/init-data.sh
<https://github.com/DefangLabs/samples/pull/474/files#diff-85c9cc6fa36ed5d05515650d7654d8bcb8554442fff1a29809245b4b77e1efea>
(47)
- *A* samples/n8n/setup.Dockerfile
<https://github.com/DefangLabs/samples/pull/474/files#diff-80d0039114745e4d309f54ac715b7432358cfc71db63417028df03db274b15a0>
(5)
Patch Links:
- https://github.com/DefangLabs/samples/pull/474.patch
- https://github.com/DefangLabs/samples/pull/474.diff
—
Reply to this email directly, view it on GitHub
<#474>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG6MLZYLEDFUOSEPKJRW2D3WIRQFAVCNFSM6AAAAACHHLUEC6VHI2DSMVQWIX3LMV43ASLTON2WKOZTGQ2DGNZSGE4TCMQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Are saying to hardcode the value to the |
|
DISREGARD - Email autoresponder went wacky
…----------
Hey Kevin,
Thanks for the PR! I've added the env vars in the deploy.yaml and will help
set up the 1-click deploy after merging. Looking forward to having n8n as
part of our samples.
Best,
Raphaël
Raphaël Titsworth-Morin (he/him)
Co-Founder | Éphémère Creative Ltd
https://ephemerecreative.ca
Let's build something good together.
On Mon, Oct 6, 2025 at 10:37 AM ***@***.*** wrote:
*KevyVo* left a comment (DefangLabs/samples#474)
<#474 (comment)>
Hey Kevin, Thanks for the mention. For the env vars in deploy.yaml, you
can put them in the env section of the n8n service. For 1-click deploy,
I'll help set that up once the PR is merged. Best, Raphaël Raphaël
Titsworth-Morin (he/him) Co-Founder | Éphémère Creative Ltd
ephemerecreative.ca Let's build something good together.
… <#>
On Mon, Oct 6, 2025 at 10:25 AM *@*.*** wrote: By popular require, n8n
https://n8n.io/ is added to the list of samples. Since we do not support
volumes right now, all the volumes in the compose.dev.yaml will be used for
only local development. Only two small items I help from @raphaeltm
<https://github.com/raphaeltm> https://github.com/raphaeltm is to setup
1click deploy and set the env var in the deploy.yaml. I am unsure which
environment to put it in. Here are some resources I used while developing
this: -
https://github.com/n8n-io/n8n-hosting/tree/main/docker-compose/withPostgres
<https://github.com/n8n-io/n8n-hosting/tree/main/docker-compose/withPostgres?rgh-link-date=2025-10-06T08%3A25%3A52Z>
- https://docs.n8n.io/hosting/configuration/environment-variables/ -
https://docs.n8n.io/hosting/installation/server-setups/docker-compose/ -
https://community.n8n.io/t/error-while-deploying-n8n-docker/77926 -
https://community.n8n.io/t/how-to-change-localhost-5678-from-webhook-url/27033/8
Samples Checklist ✅ All good! ------------------------------ You can view,
comment on, or merge this pull request online at: #474
<#474> Commit Summary - 0f0ce0c
<0f0ce0c>
<0f0ce0c
<0f0ce0c>>
Added n8n to samples - 1695094
<1695094>
<1695094
<1695094>>
Working n8n with Oauth - 2d4a465
<2d4a465>
<2d4a465
<2d4a465>>
update reason for volumes - b75f139
<b75f139>
<b75f139
<b75f139>>
Managed Postgres - ffe0977
<ffe0977>
<ffe0977
<ffe0977>>
n8n Public DNS - eb14aa0
<eb14aa0>
<eb14aa0
<eb14aa0>>
fix gcp setup deployment File Changes (6 files
https://github.com/DefangLabs/samples/pull/474/files) - *A*
samples/n8n/.github/workflows/deploy.yaml
https://github.com/DefangLabs/samples/pull/474/files#diff-3c5ddcabafecc6bf328a15063126c1c85f63143c97c67023d5fd425c83c27ea3
(28) - *A* samples/n8n/README.md
https://github.com/DefangLabs/samples/pull/474/files#diff-9468dc59215e010047102e5611169576d935d96c5c64d9d0dddaf9d8b3f09a33
(94) - *A* samples/n8n/compose.dev.yaml
https://github.com/DefangLabs/samples/pull/474/files#diff-b26b523e92e4d6b3f3c579cfd78fc2e974bbb63738241dc8be6a466c96f37bff
(40) - *A* samples/n8n/compose.yaml
https://github.com/DefangLabs/samples/pull/474/files#diff-c9e4bfd0cd96adb39bea69969645d51d6df017e1e9ccf4bf568eb42e3a2e40cd
(64) - *A* samples/n8n/init-data.sh
https://github.com/DefangLabs/samples/pull/474/files#diff-85c9cc6fa36ed5d05515650d7654d8bcb8554442fff1a29809245b4b77e1efea
(47) - *A* samples/n8n/setup.Dockerfile
https://github.com/DefangLabs/samples/pull/474/files#diff-80d0039114745e4d309f54ac715b7432358cfc71db63417028df03db274b15a0
(5) Patch Links: - https://github.com/DefangLabs/samples/pull/474.patch -
https://github.com/DefangLabs/samples/pull/474.diff — Reply to this email
directly, view it on GitHub <#474
<#474>>, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAG6MLZYLEDFUOSEPKJRW2D3WIRQFAVCNFSM6AAAAACHHLUEC6VHI2DSMVQWIX3LMV43ASLTON2WKOZTGQ2DGNZSGE4TCMQ
. You are receiving this because you were mentioned.Message ID: *@*.***>
Are saying to hardcode the value to the compose.yaml to the n8n section
env var like this:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=defang_user
- DB_POSTGRESDB_PASSWORD=defang12345
- N8N_HOST=n8n
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://n8n
- DB_POSTGRESDB_SSL_ENABLED=true
- DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false
ports:
- 5678:5678
links:
- postgres
depends_on:
setup:
condition: service_completed_successfully
postgres:
condition: service_healthy
—
Reply to this email directly, view it on GitHub
<#474 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG6ML47HBHS6QD577HCY2D3WIS4LAVCNFSM6AAAAACHHLUEC6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTGNZQGUYDGNRXGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Here are some issues I ran into over the last couple of days, along with how I resolved them:
|
|
Remaining issues:
I think I need help resolving the last two, I gave it my all. I am quite stump now. |
| TEST_DB_POSTGRESDB_SSL_ENABLED: ${{ secrets.TEST_DB_POSTGRESDB_SSL_ENABLED }} | ||
| TEST_DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: ${{ secrets.TEST_DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED }} |
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.
Why are these config? @KevyVo @raphaeltm
By popular demand, n8n is added to the list of samples. Since we do not support volumes right now, all the volumes in the compose.dev.yaml will be used for only local development.
Here are some resources I used while developing this:
Samples Checklist
✅ All good!