Files
Docker_Compose/480T/n8n_service/docker-compose.yaml
T
2026-07-26 01:06:12 +08:00

53 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
postgres:
image: postgres:16
container_name: n8n-postgres
restart: unless-stopped
environment:
POSTGRES_USER: n8n
POSTGRES_PASSWORD: CHANGE_ME_STRONG_PASSWORD
POSTGRES_DB: n8n
volumes:
- n8n_postgres_data:/var/lib/postgresql/data
n8n:
image: docker.n8n.io/n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
depends_on:
- postgres
ports:
- "3300:5678"
environment:
# ===== 时区 =====
TZ: Asia/Shanghai
GENERIC_TIMEZONE: Asia/Shanghai
# ===== 权限 & 运行机制(官方参数)=====
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: "true"
N8N_RUNNERS_ENABLED: "true"
N8N_SECURE_COOKIE: "false"
# ===== 数据库(Postgres=====
DB_TYPE: postgresdb
DB_POSTGRESDB_HOST: ${DB_POSTGRESDB_HOST}
DB_POSTGRESDB_PORT: ${DB_POSTGRESDB_PORT}
DB_POSTGRESDB_DATABASE: ${DB_POSTGRESDB_DATABASE}
DB_POSTGRESDB_USER: ${DB_POSTGRESDB_USER}
DB_POSTGRESDB_PASSWORD: ${DB_POSTGRESDB_PASSWORD}
DB_POSTGRESDB_SCHEMA: ${DB_POSTGRESDB_SCHEMA}
# ===== 强烈建议:首次就固定(不要后面改)=====
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
# 可选:限制注册/简易认证(看你的版本/用法)
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: ${N8N_BASIC_AUTH_USER}
N8N_BASIC_AUTH_PASSWORD: ${N8N_BASIC_AUTH_PASSWORD}
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
n8n_postgres_data: