-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathdocker-compose-core.yml
More file actions
95 lines (88 loc) · 2.61 KB
/
docker-compose-core.yml
File metadata and controls
95 lines (88 loc) · 2.61 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
#
# Copyright (c) 2013-Now https://jeesite.com All rights reserved.
# No deletion without permission, or be held responsible to law.
# @author ThinkGem
#
# 执行 docker-compose up 前,请先编译项目 mvn package
#
name: jeesite-cloud-core
# ==================== Environment ====================
x-common-env: &common-env
TZ: Asia/Shanghai
LANG: C.UTF-8
MYSQL_HOST: jeesite-cloud-mysql
REDIS_HOST: jeesite-cloud-redis
NACOS_HOST: jeesite-cloud-nacos
# ==================== Service Base ====================
x-service-base: &service-base
image: docker.1ms.run/eclipse-temurin:17
environment: *common-env
working_dir: /app
command: >
sh -c "if [ ! -d 'web' ]; then mkdir web && cp web.war web && cd web && jar -xvf web.war &&
rm web.war && cd ..; fi && cd web/WEB-INF && exec sh startup.sh"
#restart: unless-stopped
networks:
- jeesite-cloud-network
services:
# ==================== Core ====================
jeesite-cloud-core:
<<: *service-base
container_name: jeesite-cloud-core
ports:
- "8981:8981"
environment:
<<: *common-env
JAVA_OPTS: >
-Dspring.profiles.active=prod -DcustomLogPath=/data
-Dserver.port=8981 -Djeesite.initdata=true
volumes:
- ./.docker/modules:/data
- ./modules/core/core/target:/app
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8981/js"]
interval: 5s
timeout: 5s
retries: 60
# ==================== Files ====================
jeesite-cloud-files:
<<: *service-base
container_name: jeesite-cloud-files
environment:
<<: *common-env
JAVA_OPTS: >
-Dspring.profiles.active=prod -DcustomLogPath=/data
-Dserver.port=8988
volumes:
- ./.docker/modules:/data
- ./modules/core/files/target:/app
depends_on:
jeesite-cloud-core:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8988/js"]
interval: 5s
timeout: 5s
retries: 60
# ==================== Gateway ====================
jeesite-cloud-gateway:
<<: *service-base
container_name: jeesite-cloud-gateway
ports:
- "8980:8980"
environment:
<<: *common-env
JAVA_OPTS: -Dspring.profiles.active=prod -DcustomLogPath=/data
volumes:
- ./.docker/modules:/data
- ./gateway/target:/app
depends_on:
jeesite-cloud-core:
condition: service_healthy
jeesite-cloud-files:
condition: service_healthy
# ==================== Networks ====================
networks:
jeesite-cloud-network:
name: jeesite-cloud-network
external: true