forked from thecloudsphere/service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
176 lines (162 loc) · 4.7 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
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
170
171
172
173
174
175
176
---
services:
traefik:
image: ${TCS_IMAGE_TRAEFIK}
restart: always
command:
- "--api.insecure=true"
- "--providers.file=true"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
ports:
- ${TCS_LISTEN_ADDRESS}:443:443
- ${TCS_LISTEN_ADDRESS_INTERNAL_SERVICES}:8080:8080
volumes:
- "./files/traefik/certificates:/etc/traefik/certificates:ro"
- "./files/traefik/certificates.yml:/etc/traefik/dynamic/certificates.yml:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
phpredisadmin:
image: ${TCS_IMAGE_PHPREDISADMIN}
restart: always
environment:
REDIS_1_HOST: redis
REDIS_1_NAME: redis
ports:
- ${TCS_LISTEN_ADDRESS_INTERNAL_SERVICES}:10000:80
phpmyadmin:
image: ${TCS_IMAGE_PHPMYADMIN}
restart: always
environment:
PMA_HOST: mariadb
ports:
- ${TCS_LISTEN_ADDRESS_INTERNAL_SERVICES}:10001:80
depends_on:
mariadb:
condition: service_healthy
mariadb:
image: ${TCS_IMAGE_MARIADB}
restart: always
environment:
MARIADB_ROOT_PASSWORD: ${TCS_DATABASE_ROOT_PASSWORD}
MARIADB_DATABASE: tcs
MARIADB_USER: tcs
MARIADB_PASSWORD: ${TCS_DATABASE_PASSWORD}
volumes:
- mariadb:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "--silent"]
minio:
image: ${TCS_IMAGE_MINIO}
restart: always
command: server /data --address ":9000" --console-address ":9001"
ports:
- ${TCS_LISTEN_ADDRESS_INTERNAL_SERVICES}:9001:9001
environment:
MINIO_SERVER_URL: https://${TCS_DOMAIN_MINIO}
volumes:
- minio-1:/data1
- minio-2:/data2
labels:
- "traefik.enable=true"
- "traefik.http.services.minio.loadbalancer.server.port=9000"
- "traefik.http.services.minio.loadbalancer.passhostheader=true"
- "traefik.http.routers.minio-secure.rule=Host(`${TCS_DOMAIN_MINIO}`)"
- "traefik.http.routers.minio-secure.entrypoints=https"
- "traefik.http.routers.minio-secure.tls=true"
opa:
image: ${TCS_IMAGE_OPA}
restart: always
command: run --server -c /config.yaml /tcs.rego
volumes:
- ./files/opa/config.yaml:/config.yaml:ro
- ./files/opa/tcs.rego:/tcs.rego:ro
redis:
image: ${TCS_IMAGE_REDIS}
restart: always
rabbitmq:
image: ${TCS_IMAGE_RABBITMQ}
restart: always
keycloak:
image: ${TCS_IMAGE_KEYCLOAK}
restart: always
command: start-dev --proxy edge --import-realm --http-port 80
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: ${TCS_KEYCLOAK_ADMIN_PASSWORD}
volumes:
- ./files/keycloak:/opt/keycloak/data/import:ro
labels:
- "traefik.enable=true"
- "traefik.http.services.keycloak.loadbalancer.server.port=80"
- "traefik.http.routers.keycloak-secure.rule=Host(`${TCS_DOMAIN_KEYCLOAK}`)"
- "traefik.http.routers.keycloak-secure.entrypoints=https"
- "traefik.http.routers.keycloak-secure.tls=true"
beat:
image: ${TCS_IMAGE}
restart: always
command: "python3 -m tcs.cmd.beat"
volumes:
- ./tcs:/app
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- redis
- rabbitmq
flower:
image: ${TCS_IMAGE}
restart: always
command: "python3 -m tcs.cmd.flower"
volumes:
- ./tcs:/app
depends_on:
- redis
- rabbitmq
ports:
- ${TCS_LISTEN_ADDRESS_INTERNAL_SERVICES}:10002:5555
worker:
image: ${TCS_IMAGE}
restart: always
command: "python3 -m tcs.cmd.worker"
volumes:
- ./tcs:/app
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- redis
- rabbitmq
api:
image: ${TCS_IMAGE}
restart: always
command: "python3 -m tcs.cmd.api"
volumes:
- ./tcs:/app
depends_on:
redis:
condition: service_started
rabbitmq:
condition: service_started
beat:
condition: service_started
keycloak:
condition: service_started
mariadb:
condition: service_healthy
worker:
condition: service_started
labels:
- "traefik.enable=true"
- "traefik.http.services.api.loadbalancer.server.port=8080"
- "traefik.http.services.api.loadbalancer.passhostheader=true"
- "traefik.http.routers.api-secure.rule=Host(`${TCS_DOMAIN_API}`)"
- "traefik.http.routers.api-secure.entrypoints=https"
- "traefik.http.routers.api-secure.tls=true"
volumes:
mariadb:
minio-1:
minio-2:
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1400