Skip to content

Commit 9bf44c4

Browse files
committed
playground compose file
1 parent e47eaeb commit 9bf44c4

File tree

6 files changed

+39
-30
lines changed

6 files changed

+39
-30
lines changed

.github/workflows/deploy-changed-samples.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ jobs:
107107
TEST_TAVILY_API_KEY: ${{ secrets.TEST_TAVILY_API_KEY }}
108108
TEST_ALLOWED_HOSTS: ${{ secrets.TEST_ALLOWED_HOSTS }}
109109
TEST_N8N_ENCRYPTION_KEY: ${{ secrets.TEST_N8N_ENCRYPTION_KEY }}
110-
TEST_DB_POSTGRESDB_SSL_ENABLED: ${{ secrets.TEST_DB_POSTGRESDB_SSL_ENABLED }}
111-
TEST_DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: ${{ secrets.TEST_DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED }}
112110
TEST_DB_POSTGRESDB_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }}
113111
run: |
114112
SAMPLES=$(sed 's|^samples/||' changed_samples.txt | paste -s -d ',' -)

samples/n8n/.github/workflows/deploy.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
- name: Deploy
2121
uses: DefangLabs/[email protected]
2222
with:
23-
config-env-vars: POSTGRES_USER N8N_ENCRYPTION_KEY DB_POSTGRESDB_SSL_ENABLED DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED
23+
config-env-vars: POSTGRES_USER N8N_ENCRYPTION_KEY
2424
env:
2525
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
2626
N8N_ENCRYPTION_KEY: ${{ secrets.N8N_ENCRYPTION_KEY }}
27-
DB_POSTGRESDB_SSL_ENABLED: ${{ secrets.DB_POSTGRESDB_SSL_ENABLED }}
28-
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: ${{ secrets.DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED }}

samples/n8n/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,13 @@ For this sample, you will need to provide the following [configuration](https://
3434

3535
The password for your Postgres database. You need to set this before deploying for the first time.
3636

37-
*You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`*
37+
_You can easily set this to a random string using `defang config set POSTGRES_PASSWORD --random`_
3838

3939
### `N8N_ENCRYPTION_KEY`
4040

41-
The encryption key for your n8n instance. This is used to encrypt sensitive data in the database.
42-
43-
*You can easily set this to a random string using `defang config set N8N_ENCRYPTION_KEY --random`*
44-
45-
### `DB_POSTGRESDB_SSL_ENABLED`
46-
47-
Set to `true` to enable SSL. Set to `false` to disable SSL.
48-
49-
### `DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED`
50-
51-
Set to `true` to reject unauthorized certificates. Set to `false` to accept unauthorized certificates. Counterintuitive, but leave this as **true** to **disable SSL** (required for local dev and playground).
41+
The encryption key for your n8n instance. This is used to encrypt sensitive data in the database.
5242

43+
_You can easily set this to a random string using `defang config set N8N_ENCRYPTION_KEY --random`_
5344

5445
## Deployment
5546

@@ -61,13 +52,27 @@ Set to `true` to reject unauthorized certificates. Set to `false` to accept unau
6152
Deploy your application to the Defang Playground by opening up your terminal and typing:
6253

6354
```bash
64-
defang compose up
55+
defang compose -f compose.playground.yaml up
6556
```
6657

6758
### BYOC
6859

6960
If you want to deploy to your own cloud account, you can [use Defang BYOC](https://docs.defang.io/docs/tutorials/deploy-to-your-cloud).
7061

62+
There no need to specify a compose file, as the default `compose.yaml` will be used.
63+
64+
## Tips and Troubleshooting
65+
66+
If you like to learn more about n8n configuration, check out the [n8n docs](https://docs.n8n.io/hosting/configuration/environment-variables/).
67+
68+
### `DB_POSTGRESDB_SSL_ENABLED`
69+
70+
Set to `true` to enable SSL. Set to `false` to disable SSL.
71+
72+
### `DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED`
73+
74+
Set to `true` to reject unauthorized certificates. Set to `false` to accept unauthorized certificates. Counterintuitive, but leave this as **true** to **disable SSL** (required for local dev and playground).
75+
7176
---
7277

7378
Title: n8n

samples/n8n/compose.dev.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ services:
77
- POSTGRES_PASSWORD=password
88
volumes:
99
- db_storage:/var/lib/postgresql/data
10-
healthcheck:
11-
test: ["CMD-SHELL", "pg_isready -h localhost -U n8nuser -d n8ndatabase"]
1210

1311
n8n:
1412
extends:
@@ -18,17 +16,14 @@ services:
1816
- DB_POSTGRESDB_SSL_ENABLED=false
1917
- DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=true # counterintuitive, but leave this as true to *disable* SSL (required for local dev)
2018
- N8N_ENCRYPTION_KEY=unsafe-encryption-key
19+
- N8N_PROTOCOL=http
20+
- N8N_HOST=localhost
21+
- WEBHOOK_URL=http://localhost:5678/
22+
- N8N_PROXY_HOPS=0
2123
- DB_POSTGRESDB_PASSWORD=password
22-
ports:
23-
- 5678:5678
24-
links:
25-
- postgres
2624
volumes:
2725
- n8n_storage:/home/node/.n8n
28-
depends_on:
29-
postgres:
30-
condition: service_healthy
3126

3227
volumes:
3328
db_storage:
34-
n8n_storage:
29+
n8n_storage:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
services:
2+
postgres:
3+
extends:
4+
file: compose.yaml
5+
service: postgres
6+
7+
n8n:
8+
extends:
9+
file: compose.yaml
10+
service: n8n
11+
environment:
12+
- DB_POSTGRESDB_SSL_ENABLED=false
13+
- DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=true

samples/n8n/compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ services:
3232
- N8N_PROXY_HOPS=1 # Required behind a load balancer
3333
- NODE_ENV=production
3434
- WEBHOOK_URL=https://n8n
35-
- DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED
36-
- DB_POSTGRESDB_SSL_ENABLED
35+
- DB_POSTGRESDB_SSL_ENABLED=true
36+
- DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false
3737
# MANAGED CONFIG
3838
- N8N_ENCRYPTION_KEY
3939
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}

0 commit comments

Comments
 (0)