-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (104 loc) · 2.71 KB
/
Copy pathdocker-compose.yml
File metadata and controls
109 lines (104 loc) · 2.71 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
services:
postgres:
image: postgres:16-alpine
container_name: mimic-postgres
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?Error: POSTGRES_PASSWORD must be set in .env file}"
POSTGRES_DB: mimic
# 安全加固: 不暴露端口到主机,只允许内部网络访问
# ports:
# - "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
shm_size: 256mb
command: >
postgres
-c shared_buffers=128MB
-c max_connections=100
-c listen_addresses='*'
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- mimic-internal
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: mimic-redis
# 安全加固: 不暴露端口到主机
# ports:
# - "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- mimic-internal
restart: unless-stopped
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: mimic-backend
ports:
- "3001:3001"
environment:
DATABASE_URL: "postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/mimic"
REDIS_URL: redis://redis:6379
HOST: 0.0.0.0
PORT: "3001"
N8N_WEBHOOK_URL: http://n8n:5678/webhook/mimic-ai-generate
CALLBACK_BASE_URL: http://backend:3001
AI_GENERATION_ENABLED: "false"
DEV_AUTH_ENABLED: "${DEV_AUTH_ENABLED:-false}"
WECHAT_MP_ENABLED: "${WECHAT_MP_ENABLED:-false}"
AUTH_TOKEN_TTL_DAYS: "${AUTH_TOKEN_TTL_DAYS:-30}"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/health"]
interval: 10s
timeout: 5s
retries: 5
networks:
- mimic-internal
restart: unless-stopped
n8n:
image: n8nio/n8n:latest
container_name: mimic-n8n
ports:
- "5678:5678"
environment:
- N8N_BASIC_AUTH_ACTIVE=false
- N8N_HOST=0.0.0.0
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://hack.kinaz.me/
- GENERIC_TIMEZONE=Asia/Shanghai
volumes:
- n8n_data:/home/node/.n8n
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- mimic-internal
restart: unless-stopped
networks:
mimic-internal:
driver: bridge
volumes:
postgres_data:
redis_data:
n8n_data: