-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
101 lines (95 loc) · 2.15 KB
/
docker-compose.yml
File metadata and controls
101 lines (95 loc) · 2.15 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
version: '3.8'
services:
# MySQL数据库
mysql:
image: mysql:8.0
container_name: rule-engine-mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: rule_engine
MYSQL_USER: ruleengine
MYSQL_PASSWORD: ruleengine123
TZ: Asia/Shanghai
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./docs/database:/docker-entrypoint-initdb.d
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --default-time-zone=+08:00
networks:
- rule-engine-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
# Redis缓存
redis:
image: redis:6.2-alpine
container_name: rule-engine-redis
restart: always
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes
networks:
- rule-engine-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# 后端服务
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: rule-engine-backend
restart: always
environment:
SPRING_PROFILES_ACTIVE: prod
DB_USERNAME: ruleengine
DB_PASSWORD: ruleengine123
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ""
JWT_SECRET: YourProductionSecretKeyMustBeLongEnoughAndVerySecure123456
ports:
- "8080:8080"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- rule-engine-network
volumes:
- backend-logs:/var/log/rule-engine
# 前端服务
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: rule-engine-frontend
restart: always
ports:
- "80:80"
depends_on:
- backend
networks:
- rule-engine-network
networks:
rule-engine-network:
driver: bridge
volumes:
mysql-data:
driver: local
redis-data:
driver: local
backend-logs:
driver: local