- 删除 .env.example 文件,将默认配置直接写入 docker-compose.yml - 更新 .gitignore 添加 .idea 目录忽略 - 修改 docker-compose.yml 将环境变量硬编码为默认值 - 移除 README.md 中关于复制 .env.example 的说明 - 添加 Mac 平台兼容性配置说明和可选参数设置
41 lines
994 B
YAML
41 lines
994 B
YAML
services:
|
|
postgres:
|
|
image: postgres:15
|
|
container_name: n8n-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: n8n
|
|
POSTGRES_PASSWORD: n8npass
|
|
POSTGRES_DB: n8n
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- ./postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U n8n -d n8n"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
n8n:
|
|
image: n8nio/n8n:2.2.4
|
|
container_name: n8n
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5678:5678"
|
|
# Mac 上如遇 `Restarting (139)` 可开启以下两项:
|
|
# platform: linux/amd64
|
|
# user: "0:0"
|
|
environment:
|
|
DB_TYPE: postgresdb
|
|
DB_POSTGRESDB_HOST: postgres
|
|
DB_POSTGRESDB_PORT: 5432
|
|
DB_POSTGRESDB_DATABASE: n8n
|
|
DB_POSTGRESDB_USER: n8n
|
|
DB_POSTGRESDB_PASSWORD: n8npass
|
|
TZ: Asia/Shanghai
|
|
volumes:
|
|
- ./n8n-data:/home/node/.n8n
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|