Skip to content

Conversation

KevyVo
Copy link
Contributor

@KevyVo KevyVo commented Sep 23, 2025

By popular require, 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!

@KevyVo KevyVo self-assigned this Sep 23, 2025
@KevyVo KevyVo had a problem deploying to deploy-changed-samples September 23, 2025 05:19 — with GitHub Actions Failure
@KevyVo KevyVo marked this pull request as draft September 23, 2025 05:20
Comment on lines 21 to 29
postgres:
extends:
file: compose.dev.yaml
service: postgres

n8n:
extends:
file: compose.dev.yaml
service: n8n
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevyVo extends relationship should be reversed: the compose.dev.yaml file should extend the compose.yaml file and modify things that are dev-specific.

file: compose.dev.yaml
service: postgres

n8n:
Copy link
Collaborator

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.

depends_on:
- postgres

postgres:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Production compose.yaml file should include the x-defang-postgres extension.


[![1-click-deploy](https://raw.githubusercontent.com/DefangLabs/defang-assets/main/Logos/Buttons/SVG/deploy-with-defang.svg)](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.
Copy link
Collaborator

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.


## Development

**IMPORTANT:** But before you do that change the default users and passwords in the [`.env`](.env) file!
Copy link
Collaborator

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.

@lionello
Copy link
Member

I personally prefer if compose.yaml is for local/dev and compose.prod.yaml extends that one.

@raphaeltm
Copy link
Collaborator

I personally prefer if compose.yaml is for local/dev and compose.prod.yaml extends that one.

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 -f flag to get things deployed properly with Defang. That's why we structured every other sample with compose.yaml to cloud, and compose.dev.yaml for local dev.

@raphaeltm raphaeltm had a problem deploying to deploy-changed-samples September 25, 2025 08:48 — with GitHub Actions Failure
@KevyVo KevyVo had a problem deploying to deploy-changed-samples September 30, 2025 00:54 — with GitHub Actions Failure
@KevyVo KevyVo had a problem deploying to deploy-changed-samples September 30, 2025 09:36 — with GitHub Actions Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants