-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
108 lines (99 loc) · 2.32 KB
/
docker-compose.yml
File metadata and controls
108 lines (99 loc) · 2.32 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
services:
frontend:
build:
context: ./easydo-frontend
dockerfile: Dockerfile
args:
GIT_COMMIT: ${GIT_COMMIT:-unknown}
GIT_COMMIT_SHORT: ${GIT_COMMIT_SHORT:-unknown}
GIT_DATE: ${GIT_DATE:-unknown}
ports:
- "80:80"
depends_on:
- server
networks:
- easydo-network
restart: unless-stopped
server:
build:
context: ./easydo-server
dockerfile: Dockerfile
args:
GIT_COMMIT: ${GIT_COMMIT:-unknown}
GIT_COMMIT_SHORT: ${GIT_COMMIT_SHORT:-unknown}
GIT_DATE: ${GIT_DATE:-unknown}
ports:
- "8080:8080"
environment:
# Server配置
- SERVER_PORT=8080
- SERVER_MODE=debug
# Database配置 (通过环境变量注入,覆盖config.yaml)
- DB_HOST=db
- DB_PORT=3306
- DB_USERNAME=root
- DB_PASSWORD=password
- DB_NAME=easydo
# Redis配置
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=
- REDIS_DB=0
# JWT配置
- JWT_SECRET=easydo-secret-key
- AUTH_TOKEN_TTL=4h
- AUTH_REFRESH_INTERVAL=10m
depends_on:
- db
- redis
networks:
- easydo-network
restart: unless-stopped
db:
image: mysql:8.0
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=easydo
- MYSQL_CHARSET=utf8mb4
- MYSQL_COLLATION=utf8mb4_unicode_ci
volumes:
- mysql_data:/var/lib/mysql
networks:
- easydo-network
restart: unless-stopped
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- easydo-network
restart: unless-stopped
agent:
build:
context: ./easydo-agent
dockerfile: Dockerfile
args:
GIT_COMMIT: ${GIT_COMMIT:-unknown}
GIT_COMMIT_SHORT: ${GIT_COMMIT_SHORT:-unknown}
GIT_DATE: ${GIT_DATE:-unknown}
environment:
# Agent配置
- EASYDO_SERVER_URL=http://server:8080
- AGENT_NAME=${AGENT_NAME:-easydo-agent}
volumes:
- agent_data:/data/agent
- /var/run/docker.sock:/var/run/docker.sock
networks:
- easydo-network
restart: unless-stopped
networks:
easydo-network:
driver: bridge
volumes:
mysql_data:
redis_data:
agent_data: