-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
102 lines (96 loc) · 2.89 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
102 lines (96 loc) · 2.89 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
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: crm-mysql
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: crm
MYSQL_USER: crm_user
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
volumes:
- mysql-data:/var/lib/mysql
- ./init-scripts:/docker-entrypoint-initdb.d
networks:
- crm-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
crm-backend:
image: ${ACR_REGISTRY}/crm-backend:latest
container_name: crm-backend
restart: always
ports:
- "8080:8080"
environment:
- SERVER_PORT=8080
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/crm?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=crm_user
- SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver
- CUSTOMER_CENTER_BASE_URL=http://customer-center:8081
- MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=health
depends_on:
mysql:
condition: service_healthy
networks:
- crm-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 60s
customer-center:
image: ${ACR_REGISTRY}/customer-center:latest
container_name: customer-center
restart: always
ports:
- "8081:8081"
environment:
- SERVER_PORT=8081
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/customer_center?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
- SPRING_DATASOURCE_USERNAME=crm_user
- SPRING_DATASOURCE_PASSWORD=${MYSQL_PASSWORD}
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.cj.jdbc.Driver
- MANAGEMENT_ENDPOINTS_WEB_EXPOSURE_INCLUDE=health
depends_on:
mysql:
condition: service_healthy
networks:
- crm-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/actuator/health"]
interval: 10s
timeout: 5s
retries: 10
start_period: 60s
frontend:
image: ${ACR_REGISTRY}/crm-frontend:latest
container_name: crm-frontend
restart: always
ports:
- "80:80"
depends_on:
crm-backend:
condition: service_healthy
customer-center:
condition: service_healthy
networks:
- crm-network
volumes:
mysql-data:
name: crm-mysql-data
networks:
crm-network:
driver: bridge