-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose-gke.yaml
More file actions
239 lines (229 loc) · 7.73 KB
/
Copy pathdocker-compose-gke.yaml
File metadata and controls
239 lines (229 loc) · 7.73 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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
version: '3.7'
services:
# Website Microservice
# This is the website arclytics.io container that can be deployed to
# a Kubernetes service.
website:
build:
context: ./arclytics.io/client/
dockerfile: Dockerfile
args:
- NODE_ENV=production
labels:
arclytics.io: "production"
service: "website"
image: gcr.io/arclytics/arc_sim_website:latest
ports:
- 8080:8080
expose:
- 8080
# Fluentd Microservice
# This is the `fluentd` logger container that ingests all logs from Docker and
# acts as a centralised logging layer.
fluentd:
build:
context: ./services/fluentd
dockerfile: Dockerfile-prod
labels:
arclytics.io: "production"
service: "fluentd"
image: gcr.io/arclytics/arc_fluentd:latest
restart: always
ports:
- 24224:24224
- 24224:24224/udp
- 9880:9880
expose:
- 24224
- 9880
# Client Microservice
# This is the React front-end container that the client can access via the
# Nginx HTTP server. This container is built in production mode and it is
# the static files are copied to a Nginx HTTP server container.
client:
build:
context: ./services/client
dockerfile: Dockerfile-prod
args:
- NODE_ENV=production
- REACT_APP_SIM_HOST=https://api.arclytics.io
- REACT_APP_SIM_PORT=443
- REACT_APP_ARC_HOST=https://api.arclytics.io
- REACT_APP_ARC_PORT=443
- REACT_APP_FLUENTD_URL=https://app.arclytics.io/logger
labels:
arclytics.io: "production"
service: "client"
image: gcr.io/arclytics/arc_sim_client:2.0.0
ports:
- 8080:8080
expose:
- 8080
environment:
- NODE_ENV=production
- REACT_APP_SIM_HOST=https://api.arclytics.io
- REACT_APP_SIM_PORT=443
- REACT_APP_ARC_HOST=https://api.arclytics.io
- REACT_APP_ARC_PORT=443
- REACT_APP_FLUENTD_URL=https://app.arclytics.io/logger
# SimCCT Microservice
# This is the main service that provides user and admin management, authentication,
# authorization, server-side session and cookie management, and the RESTful API
# for the `arc_simulation` package. The `arc_simulation` package is a submodule
# that provides the algorithm for phase transformation calculations. This service
# is written with the Flask microframework and contains additional Flask plugins
# provided by the open-source community.
simcct:
build:
context: ./services/simcct
dockerfile: Dockerfile-prod
labels:
arclytics.io: "production"
service: "simcct"
image: gcr.io/arclytics/arc_sim_service:2.0.0
ports:
- 8000:8000
expose:
- 8000
environment:
- FLASK_APP=sim_api/__init__.py
- FLASK_ENV=production
- APP_SETTINGS=configs.flask_conf.ProductionConfig
- SECRET_KEY=${SECRET_KEY}
- SECURITY_PASSWORD_SALT=${SECURITY_PASSWORD_SALT}
- MONGO_HOST=mongo-service
- MONGO_PORT=27017
- MONGO_APP_DB=${MONGO_APP_DB}
- MONGO_APP_USER=${MONGO_APP_USER}
- MONGO_APP_USER_PASSWORD=${MONGO_APP_USER_PASSWORD}
- REDIS_HOST=redis-service
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- CLIENT_SCHEME=https
- CLIENT_HOST=app.arclytics.io
- CLIENT_PORT=443
- FLUENTD_HOST=fluentd-service
- FLUENTD_PORT=24224
- FLUENTD_PREFIX_TAG=simcct
- ELASTIC_APM_SERVER_URL=http://apm-service:8200
- ELASTIC_APM_SECRET_TOKEN=${SECRET_TOKEN}
# Celery-Worker Microservice
# This container contains a Flask instance of a Celery worker node that performs
# asynchronous tasks based on the message queue from Redis and stores the result
# in the Redis backend.
celery-worker:
build:
context: ./services/celery-worker
dockerfile: Dockerfile-prod
labels:
arclytics.io: "production"
service: "celery-worker"
image: gcr.io/arclytics/arc_sim_celery:2.0.0
ports:
- 5555:5555
expose:
- 5555
environment:
- FLASK_ENV=production
- APP_SETTINGS=flask_conf.ProductionConfig
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USE_TLS=${MAIL_USE_TLS}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MONGO_HOST=mongo-service
- MONGO_PORT=27017
- MONGO_APP_DB=arclytics
- MONGO_APP_USER=${MONGO_APP_USER}
- MONGO_APP_USER_PASSWORD=${MONGO_APP_USER_PASSWORD}
- REDIS_HOST=redis-service
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- ELASTIC_APM_SERVER_URL=http://apm-service:8200
- ELASTIC_APM_SECRET_TOKEN=${SECRET_TOKEN}
# Arclytics Microservice
# This is the container that provides analytics for the application. It ensures
# authentication and authorization by using the same secret key as the `simcct`
# microservice and decoding the JSON Web Token that is set in the cookie.
# This service is written with the Flask microframework and contains additional
# Flask plugins provided by the open-source community.
arclytics:
build:
context: ./services/arclytics
dockerfile: Dockerfile-prod
labels:
arclytics.io: "production"
service: "arclytics"
image: gcr.io/arclytics/arclytics_service:2.0.0
ports:
- 8001:8001
expose:
- 8001
environment:
- FLASK_APP=arc_api/__init__.py
- FLASK_ENV=production
- APP_SETTINGS=configs.flask_conf.ProductionConfig
- SECRET_KEY=${SECRET_KEY}
- SIMCCT_HOST=http://simcct-service:8000/v1/sim
- REDIS_HOST=redis-service
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- MONGO_HOST=mongo-service
- MONGO_PORT=27017
- MONGO_APP_DB=arc_dev
- MONGO_APP_USER=${MONGO_APP_USER}
- MONGO_APP_USER_PASSWORD=${MONGO_APP_USER_PASSWORD}
- FLUENTD_HOST=fluentd-service
- FLUENTD_PORT=24224
- FLUENTD_PREFIX_TAG=arclytics
- ELASTIC_APM_SERVER_URL=http://apm-server:8200
- MAPBOX_TOKEN=${MAPBOX_TOKEN}
# Redis Microservice
# This is a Redis in-memory data store and persistence layer than is used by other
# services including `simcct`, `arclytics`, and `celery-worker`. It's main purpose
# is for the server-side session storage for Flask and the message queue and results
# backend for Celery.
redis:
build:
context: ./services/redis
dockerfile: Dockerfile-prod
labels:
arclytics.io: "production"
service: "redis"
image: gcr.io/arclytics/arc_sim_redis:latest
restart: always
ports:
- 6379:6379
expose:
- 6379
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
# MongoDB Microservice
# MongoDB is an open-source, general purpose, document-based, distributed
# NoSQL database. Our application uses MongoDB with a Replica Set distribution
# as the data persistence layer for our users and application data. We also
# use MongoDB’s querying language and pipelines to leverage data analytics
# about our users, application, and the simulation data.
mongodb:
build:
context: ./services/db
dockerfile: Dockerfile-prod
labels:
arclytics.io: "production"
service: "mongodb"
image: gcr.io/arclytics/arc_sim_mongo:latest
restart: always
ports:
- 27017:27017
expose:
- 27017
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_ROOT_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
- MONGO_ROOT_USER=${MONGO_ROOT_USER}
- MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD}
- MONGO_APP_DB=${MONGO_APP_DB}
- MONGO_APP_USER=${MONGO_APP_USER}
- MONGO_APP_USER_PASSWORD=${MONGO_APP_USER_PASSWORD}
- MONGO_DATA_DIR=/usr/data/db
- MONGO_LOG_DIR=/dev/null