Skip to content

Instantly share code, notes, and snippets.

@NatLee
Last active May 19, 2025 07:53
Show Gist options
  • Select an option

  • Save NatLee/2a87402783710586ac4293419d9508bf to your computer and use it in GitHub Desktop.

Select an option

Save NatLee/2a87402783710586ac4293419d9508bf to your computer and use it in GitHub Desktop.
Docker compose filt of `n8n` with Chrome container
POSTGRES_USER=root
POSTGRES_PASSWORD=my-secret-password
POSTGRES_DB=n8n
N8N_ENCRYPTION_KEY=your-super-secret-key
N8N_USER_MANAGEMENT_JWT_SECRET=even-more-cute-secret
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
# Optional timezone to set which gets used by Cron and other scheduling nodes
# New York is the default value if not set
GENERIC_TIMEZONE=Asia/Taipei
# DOMAIN_NAME and SUBDOMAIN together determine where n8n will be reachable from
# The top level domain to serve from
DOMAIN_NAME=example.com
# The subdomain to serve from
SUBDOMAIN=n8n
networks:
n8n-networks:
x-n8n: &service-n8n
image: n8nio/n8n:latest
networks: ['n8n-networks']
environment:
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_USER=${POSTGRES_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD}
- N8N_DIAGNOSTICS_ENABLED=false
- N8N_PERSONALIZATION_ENABLED=false
- N8N_ENCRYPTION_KEY
- N8N_USER_MANAGEMENT_JWT_SECRET
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
- N8N_RUNNERS_ENABLED=true
- N8N_PROXY_HOPS=1
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- NODE_FUNCTION_ALLOW_BUILTIN=*
- NODE_FUNCTION_ALLOW_EXTERNAL=axios,cheerio
env_file:
- .env
services:
postgres:
image: postgres:16-alpine
hostname: postgres
networks: ['n8n-networks']
restart: unless-stopped
container_name: n8n-postgres
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
volumes:
- ./db-data:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 5s
timeout: 5s
retries: 10
n8n:
<<: *service-n8n
hostname: n8n
container_name: n8n-server
restart: unless-stopped
ports:
- 5678:5678
volumes:
- ./n8n-main:/home/node/.n8n
depends_on:
postgres:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
chrome:
image: 'zenika/alpine-chrome:124'
container_name: n8n-chrome
entrypoint: [
"chromium-browser",
"--headless",
"--disable-gpu",
"--disable-software-rasterizer",
"--disable-dev-shm-usage",
"--no-sandbox",
"--remote-debugging-address=0.0.0.0",
"--remote-debugging-port=9222"
]
ports:
- 9222:9222
depends_on:
- n8n
networks: ['n8n-networks']
restart: unless-stopped
qdrant:
image: qdrant/qdrant
hostname: qdrant
container_name: n8n-qdrant
networks: ['n8n-networks']
restart: unless-stopped
ports:
- 6333:6333
volumes:
- ./qdrant-storage:/qdrant/storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment