-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (49 loc) · 1.35 KB
/
Copy pathdocker-compose.yml
File metadata and controls
51 lines (49 loc) · 1.35 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
services:
app:
build:
context: .
expose:
- "3001"
ports:
- "127.0.0.1:3001:3001"
environment:
- NODE_ENV=production
- DB_HOST=mysql
- DB_USER=root
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME:-expense_pro}
- JWT_SECRET=${JWT_SECRET}
- AI_BASE_URL=${AI_BASE_URL}
- DATABASE_URL=mysql://root:${DB_PASSWORD}@mysql:3306/${DB_NAME:-expense_pro}
- HTTP_PROXY=${HTTP_PROXY:-}
- HTTPS_PROXY=${HTTPS_PROXY:-}
- NO_PROXY=localhost,127.0.0.1,mysql
- TZ=${TZ:-Asia/Shanghai}
- TRUST_PROXY=${TRUST_PROXY:-loopback}
- INVITE_CODE=${INVITE_CODE:-}
- SERVER_AI_KEY=${SERVER_AI_KEY:-}
- ENCRYPTION_ENABLED=${ENCRYPTION_ENABLED:-}
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
mysql:
condition: service_healthy
restart: always
mysql:
image: mysql:8.0
ports:
- "127.0.0.1:3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME:-expense_pro}
volumes:
- mysql_data:/var/lib/mysql
restart: always
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql_data: