Files
Docker_Compose/480T/n8n_service/docker-compose.yaml
T
2026-07-26 00:30:28 +08:00

64 lines
1.7 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.
version: "3.8"
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 访问,不需要映射到宿主机端口
# ports:
# - "5432:5432"
n8n:
image: docker.n8n.io/n8nio/n8n:latest
container_name: n8n
restart: unless-stopped
depends_on:
- postgres
ports:
- "3600: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: postgres
DB_POSTGRESDB_PORT: 5432
DB_POSTGRESDB_DATABASE: n8n
DB_POSTGRESDB_USER: n8n
DB_POSTGRESDB_PASSWORD: CHANGE_ME_STRONG_PASSWORD
DB_POSTGRESDB_SCHEMA: public
# ===== 强烈建议:首次就固定(不要后面改)=====
N8N_ENCRYPTION_KEY: "XepzhV7nMbjYN"
# 可选:限制注册/简易认证(看你的版本/用法)
N8N_BASIC_AUTH_ACTIVE: "true"
N8N_BASIC_AUTH_USER: "Kun"
N8N_BASIC_AUTH_PASSWORD: "XepzhV7nMbjYN"
# ===== 如果你后面接 480T Nginx 反代(先注释也行)=====
# N8N_HOST: n8n.kunle777.top
# N8N_PROTOCOL: https
# N8N_PORT: 443
# WEBHOOK_URL: https://n8n.kunle777.top
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:
n8n_postgres_data: