forked from zhengqingya/docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-build.yml
169 lines (164 loc) · 3.91 KB
/
docker-compose-build.yml
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
version: '2.4'
services:
core:
build:
context: .
dockerfile: core/Dockerfile
args:
Version: ${Version}
TARGETARCH: ${TARGETARCH}
image: jumpserver/jms_core:${Version}
container_name: jms_core
restart: always
tty: true
command: start web
environment:
SECRET_KEY: $SECRET_KEY
BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
DEBUG: $DEBUG
LOG_LEVEL: $LOG_LEVEL
DB_HOST: $DB_HOST
DB_PORT: $DB_PORT
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
REDIS_HOST: $REDIS_HOST
REDIS_PORT: $REDIS_PORT
REDIS_PASSWORD: $REDIS_PASSWORD
healthcheck:
test: "curl -f http://localhost:8080/api/health/"
interval: 10s
timeout: 5s
retries: 3
start_period: 60s
volumes:
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- ${VOLUME_DIR}/core/logs:/opt/jumpserver/logs
networks:
- net
celery:
image: jumpserver/jms_core:${Version}
container_name: jms_celery
restart: always
tty: true
command: start task
environment:
SECRET_KEY: $SECRET_KEY
BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
DEBUG: $DEBUG
LOG_LEVEL: $LOG_LEVEL
DB_HOST: $DB_HOST
DB_PORT: $DB_PORT
DB_USER: $DB_USER
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
REDIS_HOST: $REDIS_HOST
REDIS_PORT: $REDIS_PORT
REDIS_PASSWORD: $REDIS_PASSWORD
depends_on:
core:
condition: service_healthy
healthcheck:
test: "/opt/py3/bin/python /opt/jumpserver/apps/manage.py check_celery"
interval: 10s
timeout: 10s
retries: 3
start_period: 30s
volumes:
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- ${VOLUME_DIR}/core/logs:/opt/jumpserver/logs
networks:
- net
koko:
build:
context: .
dockerfile: koko/Dockerfile
args:
Version: ${Version}
TARGETARCH: ${TARGETARCH}
image: jumpserver/jms_koko:${Version}
container_name: jms_koko
restart: always
privileged: true
tty: true
environment:
CORE_HOST: http://core:8080
BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
LOG_LEVEL: $LOG_LEVEL
depends_on:
core:
condition: service_healthy
healthcheck:
test: "nc -z localhost 2222 && nc -z localhost 5000"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
- ${VOLUME_DIR}/koko/data:/opt/koko/data
ports:
- 2222:2222
networks:
- net
lion:
build:
context: .
dockerfile: lion/Dockerfile
args:
Version: ${Version}
TARGETARCH: ${TARGETARCH}
image: jumpserver/jms_lion:${Version}
container_name: jms_lion
restart: always
tty: true
environment:
CORE_HOST: http://core:8080
BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN
LOG_LEVEL: $LOG_LEVEL
depends_on:
core:
condition: service_healthy
healthcheck:
test: "/etc/init.d/guacd status && curl -f http://localhost:8081/lion/health/"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
- ${VOLUME_DIR}/lion/data:/opt/lion/data
networks:
- net
nginx:
build:
context: .
dockerfile: nginx/Dockerfile
args:
Version: ${Version}
TARGETARCH: ${TARGETARCH}
image: jumpserver/jms_nginx:${Version}
container_name: jms_nginx
restart: always
tty: true
depends_on:
core:
condition: service_healthy
healthcheck:
test: "curl -f http://localhost"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
volumes:
- ${VOLUME_DIR}/core/data:/opt/jumpserver/data
- ${VOLUME_DIR}/nginx/data/logs:/var/log/nginx
ports:
- 80:80
networks:
- net
networks:
net:
driver: bridge
ipam:
driver: default
config:
- subnet: $DOCKER_SUBNET