Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (66 loc) · 3.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
69 lines (66 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Local n8n for LendLoop. Secrets come from n8n/.env (git-ignored), never from this file.
# See n8n/README.md for setup, the tunnel, importing workflows and reading the mock outbox.
services:
n8n:
# Pinned: n8n 2.x changed Code node defaults (task runners, env access). Bump deliberately
# and re-check the "n8n version notes" in n8n/README.md when you do.
image: n8nio/n8n:2.47.1
restart: unless-stopped
# Bound to this machine only: the editor and its login page are never on the network or the
# tunnel. The tunnel reaches webhooks through the `edge` proxy below.
ports:
- "127.0.0.1:5678:5678"
# n8n/.env holds CONVEX_TO_N8N_SECRET, N8N_TO_CONVEX_SECRET, CONVEX_SITE_URL, WEBHOOK_URL
# and optionally ALERT_WEBHOOK_URL (template: n8n/.env.example).
# WEBHOOK_URL (your public tunnel URL) is passed through from there; it is deliberately not
# repeated below, because an entry under `environment:` would override the env_file value.
env_file:
- ./n8n/.env
environment:
- GENERIC_TIMEZONE=Asia/Karachi
- TZ=Asia/Karachi
# n8n 2.x runs every Code node in a task runner. Internal mode = a child process inside
# this container (same filesystem, so the mock outbox works). Fine for a local instance
# holding mock data only; production should use external mode (see n8n/README.md).
- N8N_RUNNERS_MODE=internal
# Code nodes may require only these builtins: crypto (HMAC), fs (mock outbox).
# In internal mode n8n passes this variable through to the runner process.
- NODE_FUNCTION_ALLOW_BUILTIN=crypto,fs
# n8n 2.x blocks $env in Code nodes and expressions by default; the workflows read
# their secrets from $env so nothing secret is ever stored in workflow JSON.
- N8N_BLOCK_ENV_ACCESS_IN_NODE=false
# Mock notifications and error alerts are appended here (JSON lines, emails masked)
- LENDLOOP_MOCK_OUTBOX=/home/node/.n8n/mock-outbox.log
# Execution logs contain the webhook payload (one recipient email): keep them one week only
- EXECUTIONS_DATA_PRUNE=true
- EXECUTIONS_DATA_MAX_AGE=168
# Requests arrive through one proxy (edge); trust its X-Forwarded-* headers for the client IP.
- N8N_PROXY_HOPS=1
volumes:
- n8n_data:/home/node/.n8n
# The only public door into n8n: forwards /webhook/* and /healthz, answers 404 to everything
# else (editor, login, REST API). See n8n/edge/nginx.conf.
edge:
image: nginx:1.27-alpine
profiles: ["tunnel"]
restart: unless-stopped
volumes:
- ./n8n/edge/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- n8n
# Optional public URL for n8n's webhooks, because cloud Convex cannot reach this machine.
# Start with `docker compose --profile tunnel up -d`, then read the
# https://<random>.trycloudflare.com URL from `docker compose logs tunnel`.
# A quick tunnel needs no Cloudflare account; its URL changes on every restart. It points at
# `edge`, never at n8n directly: a quick tunnel has no ingress rules of its own.
tunnel:
image: cloudflare/cloudflared:2026.10.0
profiles: ["tunnel"]
restart: unless-stopped
# HTTP/2 over TCP: on this network the default QUIC (UDP) link dropped a quick tunnel after
# 36 min idle ("no recent network activity"), and a dropped quick tunnel never comes back.
command: tunnel --no-autoupdate --protocol http2 --url http://edge:80
depends_on:
- edge
volumes:
n8n_data: