This repository has been archived by the owner on Mar 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
120 lines (113 loc) · 3 KB
/
docker-compose.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
x-restart-policy: &restart_policy
restart: unless-stopped
x-depends_on-healthy: &depends_on-healthy
condition: service_healthy
x-healthcheck-defaults: &healthcheck_defaults
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
services:
mysql:
<<: *restart_policy
image: mysql:5.7.22
container_name: mysql
command: >
--character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
--explicit_defaults_for_timestamp=true --lower_case_table_names=1
ports:
- "3306:3306"
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: dora
healthcheck:
<<: *healthcheck_defaults
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost", '-u', 'root', '-p$MYSQL_ROOT_PASSWORD' ]
volumes:
- ./mysql/data:/var/lib/mysql
- ./mysql/init:/docker-entrypoint-initdb.d
redis:
<<: *restart_policy
image: redis:6
container_name: redis
command: >
--requirepass ${REDIS_PASSWORD}
healthcheck:
<<: *healthcheck_defaults
test: [ "CMD", "redis-cli" ,"-a", "$REDIS_PASSWORD", "ping" ]
ports:
- "6379:6379"
volumes:
- ./redis/data:/data
elasticsearch:
<<: *restart_policy
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.0
container_name: elasticsearch
ports:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xmx1g -Xms1g"
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}
discovery.type: single-node
xpack.license.self_generated.type: "basic"
xpack.security.enabled: "true"
xpack.monitoring.collection.enabled: "false"
healthcheck:
<<: *healthcheck_defaults
test: curl -u elastic:${ELASTIC_PASSWORD} -s -f elasticsearch:9200/_cat/health >/dev/null || exit 1
volumes:
- ./elastic/data:/usr/share/elasticsearch/data
process:
image: '$SERVER_IMAGE'
container_name: process
env_file: .env
command: [ "node", "./process/main.js" ]
volumes:
- ./logs:/server/logs
depends_on:
redis:
<<: *depends_on-healthy
elasticsearch:
<<: *depends_on-healthy
mysql:
<<: *depends_on-healthy
relay:
image: '$SERVER_IMAGE'
container_name: relay
ports:
- "8000:8000"
env_file: .env
command: [ "node", "./relay/main.js" ]
volumes:
- ./logs:/server/logs
depends_on:
redis:
<<: *depends_on-healthy
manager:
image: '$SERVER_IMAGE'
container_name: manager
ports:
- "9000:9000"
env_file: .env
command: [ "node", "./manager/main.js" ]
volumes:
- ./uploads:/server/uploads
- ./logs:/server/logs
depends_on:
redis:
<<: *depends_on-healthy
elasticsearch:
<<: *depends_on-healthy
mysql:
<<: *depends_on-healthy
webapp:
image: '$WEB_IMAGE'
container_name: webapp
ports:
- "8080:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- manager