-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdocker-compose.yml
254 lines (237 loc) · 7.04 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
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
services:
app:
build:
context: .
dockerfile: Dockerfile-dev
environment:
MACONDO_DATA_PATH: /opt/program/data
MACONDO_DEBUG: 1
DB_HOST: db
DB_PORT: "5432"
DB_USER: postgres
# If loading another db, we can change db_name below
DB_NAME: liwords
DB_PASSWORD: pass
DB_SSL_MODE: disable
SECRET_KEY: jqxztripletriple
DEBUG: 1
NATS_URL: nats://nats:4222
REGISTRATION_CODE: foobar
MAILGUN_KEY: ${MAILGUN_KEY:-default}
DISCORD_TOKEN: ${DISCORD_TOKEN:-default}
REDIS_URL: "redis://redis:6379"
GORACE: history_size=7
ARGON_MEMORY: 1024
AWS_REGION: "us-east-2"
AWS_ACCESS_KEY_ID: 'liwords'
AWS_SECRET_KEY: 'liwords-pass'
AVATAR_UPLOAD_BUCKET: woogles-uploads
USE_MINIO_S3: 1
MINIO_S3_ENDPOINT: http://minio:9000
DB_MIGRATIONS_PATH: file:///opt/program/db/migrations
PUZZLE_GENERATION_SECRET_KEY: perplexemes
ECS_CLUSTER_NAME: ${ECS_CLUSTER_NAME:-}
PUZZLE_GENERATION_TASK_DEFINITION: ${PUZZLE_GENERATION_TASK_DEFINITION:-}
OTEL_RESOURCE_ATTRIBUTES: "service.name=liwords,service.version=0.1.0"
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
PATREON_CLIENT_ID: UhLzukHPyjascp5vNI0_AP5z_ABiz_6-sqU_y8YALVxiiJSxBqRQWFXxAox5vuqE
PATREON_CLIENT_SECRET: ${PATREON_CLIENT_SECRET:-}
PATREON_REDIRECT_URI: http://localhost/integrations/patreon/callback
TWITCH_CLIENT_ID: ${TWITCH_CLIENT_ID:-}
TWITCH_CLIENT_SECRET: ${TWITCH_CLIENT_SECRET:-}
TWITCH_REDIRECT_URI: http://localhost/integrations/twitch/callback
volumes:
- .:/opt/program:rw
- ./data/lexica/gaddag:/opt/program/data/lexica/gaddag
- ../macondo/data/strategy:/opt/program/data/strategy
- ${AWS_CREDENTIALS_PATH:-~/.aws}:/root/.aws:ro
command: sh -c "go run -race cmd/liwords-api/*.go"
depends_on:
[
"db",
"proxy",
"nats",
"socket",
"redis",
"minio"
]
networks:
- aeronet
ports:
- "8001:8001"
labels:
- "traefik.http.middlewares.floc.headers.customresponseheaders.Permissions-Policy=interest-cohort=()"
- "traefik.http.routers.liwords.middlewares=floc"
- "traefik.http.routers.liwords.rule=PathPrefix(`/api/`, `/gameimg/`, `/debug/`, `/integrations/`)"
- "traefik.http.routers.liwords.entrypoints=web"
- "traefik.http.services.liwords.loadbalancer.server.port=8001"
- traefik.enable=true
bot:
build:
context: ../macondo
dockerfile: Dockerfile-bot-dev
environment:
MACONDO_DATA_PATH: /opt/program/data
MACONDO_NATS_URL: nats://nats:4222
MACONDO_DEBUG: 1
MACONDO_WOLGES_AWSM_URL: http://wolges_awsm:4500
volumes:
- ../macondo:/opt/program:rw
# Use the same gaddag files we use for the WASM integration.
- ./data/lexica/gaddag:/opt/program/data/lexica/gaddag
- ${AWS_CREDENTIALS_PATH:-~/.aws}:/root/.aws:ro
command: sh -c "go run -race cmd/bot/*.go"
depends_on: [ "nats" ]
networks:
- aeronet
# Needed for bot to play wordsmog. Comment out if not using.
# Requires https://github.com/andy-k/wolges-awsm to be cloned
# at the level of `liwords`.
# wolges_awsm:
# build:
# context: ../wolges-awsm
# dockerfile: Dockerfile
# volumes:
# - ./liwords-ui/public/wasm/2024:/app/data
# ports:
# - "4500:4500"
# networks:
# - aeronet
socket:
&socketsetup
build:
context: ../liwords-socket
dockerfile: Dockerfile-dev
environment:
SECRET_KEY: jqxztripletriple
DEBUG: 1
NATS_URL: nats://nats:4222
volumes:
- ../liwords-socket:/opt/program:rw
command: [ "go", "run", "-race", "cmd/socketsrv/main.go" ]
depends_on: [ "nats" ]
networks:
- aeronet
labels:
- "traefik.http.middlewares.floc.headers.customresponseheaders.Permissions-Policy=interest-cohort=()"
- "traefik.http.routers.liwords-socket.middlewares=floc"
- "traefik.http.routers.liwords-socket.rule=PathPrefix(`/ws`)"
- "traefik.http.routers.liwords-socket.entrypoints=web"
- "traefik.http.services.liwords-socket.loadbalancer.server.port=8087"
- traefik.enable=true
# socket2: *socketsetup
jaeger:
image: jaegertracing/all-in-one:${JAEGER_VERSION:-latest}
ports:
- "16686:16686"
- "4318:4318"
environment:
- LOG_LEVEL=debug
networks:
- aeronet
proxy:
image: "traefik:v2.2"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- aeronet
nats:
image: "nats"
ports:
- "4222:4222"
- "8222:8222"
networks:
- aeronet
redis:
image: "redis:alpine"
volumes:
- redis-data-volume:/data
ports:
- 16379:6379
networks:
- aeronet
db:
image: postgres
environment:
POSTGRES_PASSWORD: pass
POSTGRES_DB: liwords
volumes:
- pg-data-volume:/var/lib/postgresql/data
# Uncomment out below to possibly load a db dump
# see https://github.com/woogles-io/liwords/wiki/Loading-a-db-dump
- $HOME/data:/opt/data
ports:
- 15432:5432
networks:
- aeronet
minio:
image: docker.io/bitnami/minio
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ROOT_USER: liwords
MINIO_ROOT_PASSWORD: liwords-pass
volumes:
- minio_data:/data
networks:
- aeronet
createbuckets:
image: minio/mc
depends_on:
- minio
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 liwords liwords-pass;
/usr/bin/mc mb myminio/woogles-uploads;
/usr/bin/mc anonymous set public myminio/woogles-uploads;
exit 0;
"
networks:
- aeronet
frontend:
build:
context: .
dockerfile: Dockerfile-fe
volumes:
- ./liwords-ui:/opt/liwords-ui
working_dir: /opt/liwords-ui
command: bash -c "npm ci && npm start"
#command: bash -c "npm ci && npm run build && npm run preview"
networks:
- aeronet
labels:
- traefik.enable=true
- "traefik.http.middlewares.floc.headers.customresponseheaders.Permissions-Policy=interest-cohort=()"
- "traefik.http.routers.liwords-fe.middlewares=floc"
- "traefik.http.routers.liwords-fe.rule=PathPrefix(`/`)"
- "traefik.http.routers.liwords-fe.service=liwords-fe-service"
- "traefik.http.routers.liwords-fe.entrypoints=web"
- "traefik.http.services.liwords-fe-service.loadbalancer.server.port=3000"
goutils:
build:
context: .
dockerfile: Dockerfile-goutils
volumes:
- .:/opt/code/liwords:rw
- ../macondo:/opt/code/macondo
networks:
- aeronet
networks:
aeronet:
driver: bridge
volumes:
pg-data-volume:
external: false
redis-data-volume:
external: false
minio_data:
driver: local