-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon-compose.yml
169 lines (148 loc) · 4.8 KB
/
common-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
version: "3.9"
services:
# Postgres database
db:
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
image: postgres:14
user: postgres
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=postgres
volumes:
- database:/var/lib/postgresql/data
# Frontend and backend
website:
volumes:
- ~/.aws/:/root/.aws:ro
environment:
- DB_URL=db:5432/postgres
- DB_USER=postgres
- DB_PASSWORD=${DB_PASSWORD}
- APP_MICROSOFT_CLIENT_ID=${APP_MICROSOFT_CLIENT_ID}
- APP_GOOGLE_CLIENT_ID=${APP_GOOGLE_CLIENT_ID}
- PFP_S3_BUCKET=${PFP_S3_BUCKET}
- BOT_S3_BUCKET=${BOT_S3_BUCKET}
- GAME_LOGS_S3_BUCKET=${GAME_LOGS_S3_BUCKET}
- BUILD_LOGS_S3_BUCKET=${BUILD_LOGS_S3_BUCKET}
- RESUME_S3_BUCKET=${RESUME_S3_BUCKET}
- BOT_SIZE=5000000
- AZURE_SECRET=${AZURE_SECRET}
- GOOGLE_SECRET=${GOOGLE_SECRET}
- SECRET_KEY=${SECRET_KEY}
- BOT_UPLOADS_QUEUE_URL=http://sqs:9324/queue/bot_uploads
- NEW_GAMES_QUEUE_URL=http://sqs:9324/queue/new_games
- RUST_LOG=info
- S3_ADDRESS=http://s3:9000
- SQS_ADDRESS=http://sqs:9324
- PORT=3000
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- EMAIL_ADDRESS=${EMAIL_ADDRESS}
- EMAIL_APP_PASSWORD=${EMAIL_APP_PASSWORD}
- DOMAIN_NAME=${DOMAIN_NAME}
- SMTP_SERVER=${SMTP_SERVER}
gameplay:
volumes:
- ~/.aws/:/root/.aws:ro
privileged: true
init: true
environment:
- RUST_LOG=info
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- NEW_GAMES_QUEUE_URL=http://sqs:9324/queue/new_games
- GAME_RESULTS_QUEUE_URL=http://sqs:9324/queue/game_results
- S3_ADDRESS=http://s3:9000
- SQS_ADDRESS=http://sqs:9324
- COMPILED_BOT_S3_BUCKET=${COMPILED_BOT_S3_BUCKET}
- GAME_LOGS_S3_BUCKET=${GAME_LOGS_S3_BUCKET}
builder:
volumes:
- ~/.aws/:/root/.aws:ro
privileged: true
init: true
environment:
- RUST_LOG=info
- COMPILED_BOT_S3_BUCKET=${COMPILED_BOT_S3_BUCKET}
- BOT_S3_BUCKET=${BOT_S3_BUCKET}
- BUILD_LOGS_S3_BUCKET=${BUILD_LOGS_S3_BUCKET}
- BOT_UPLOADS_QUEUE_URL=http://sqs:9324/queue/bot_uploads
- BUILD_RESULTS_QUEUE_URL=http://sqs:9324/queue/build_results
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- S3_ADDRESS=http://s3:9000
- SQS_ADDRESS=http://sqs:9324
results:
volumes:
- ~/.aws/:/root/.aws:ro
environment:
- BUILD_RESULTS_QUEUE_URL=http://sqs:9324/queue/build_results
- GAME_RESULTS_QUEUE_URL=http://sqs:9324/queue/game_results
- NEW_GAMES_QUEUE_URL=http://sqs:9324/queue/new_games
- DB_URL=db:5432/postgres
- DB_USER=postgres
- DB_PASSWORD=${DB_PASSWORD}
- S3_ACCESS_KEY=${S3_ACCESS_KEY}
- S3_SECRET_KEY=${S3_SECRET_KEY}
- RUST_LOG=info
- S3_ADDRESS=http://s3:9000
- SQS_ADDRESS=http://sqs:9324
- GAME_LOGS_S3_BUCKET=${GAME_LOGS_S3_BUCKET}
- BUILD_LOGS_S3_BUCKET=${BUILD_LOGS_S3_BUCKET}
s3:
image: minio/minio
volumes:
- minio:/data
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY}
command: server /data --console-address :9999
createbuckets:
image: minio/mc
environment:
MINIO_ACCESS_KEY: ${S3_ACCESS_KEY}
MINIO_SECRET_KEY: ${S3_SECRET_KEY}
PFP_S3_BUCKET: ${PFP_S3_BUCKET}
BOT_S3_BUCKET: ${BOT_S3_BUCKET}
BUILD_LOGS_S3_BUCKET: ${BUILD_LOGS_S3_BUCKET}
GAME_LOGS_S3_BUCKET: ${GAME_LOGS_S3_BUCKET}
COMPILED_BOT_S3_BUCKET: ${COMPILED_BOT_S3_BUCKET}
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://s3:9000 $S3_ACCESS_KEY $S3_SECRET_KEY;
/usr/bin/mc mb myminio/$PFP_S3_BUCKET;
/usr/bin/mc anonymous set public myminio/$PFP_S3_BUCKET;
/usr/bin/mc mb myminio/$BOT_S3_BUCKET;
/usr/bin/mc mb myminio/$COMPILED_BOT_S3_BUCKET;
/usr/bin/mc mb myminio/$BUILD_LOGS_S3_BUCKET;
/usr/bin/mc mb myminio/$GAME_LOGS_S3_BUCKET;
/usr/bin/mc mb myminio/$RESUME_S3_BUCKET;
exit 0;
"
sqs:
image: softwaremill/elasticmq
volumes:
- ./elasticmq.conf:/opt/elasticmq.conf:ro
nginx:
image: nginx:stable
command: |
sh -c '
while :; do
sed s/DOMAIN_NAME/${DOMAIN_NAME}/g /nginx.conf.template > /etc/nginx/nginx.conf
sleep 6h & wait $${!}
nginx -s reload
done & (sleep 1 && nginx -g "daemon off;")'
volumes:
- ./.volumes/certbot/conf:/etc/letsencrypt
- ./.volumes/certbot/www:/var/www/certbot
environment:
- DOMAIN_NAME=${DOMAIN_NAME}
ports:
- 80:80
- 443:443
- 9000:9000