-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
278 lines (261 loc) · 8.43 KB
/
docker-compose.yml
File metadata and controls
278 lines (261 loc) · 8.43 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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
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
CREDENTIALS_ENCRYPTION_KEY: ZZcByQlXmdAzXoXYooUxYCtxyvpMiI0o1su+id6qMx4=
DEBUG: 1
NATS_URL: nats://nats:4222
REGISTRATION_CODE: foobar
EMAIL_DEBUG: "true"
DISCORD_TOKEN: ${DISCORD_TOKEN:-default}
REDIS_URL: "redis://redis:6379"
GORACE: history_size=7
ARGON_MEMORY: 1024
AWS_REGION: ${AWS_REGION:-"us-east-2"}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-liwords}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-liwords-pass}
AVATAR_UPLOAD_BUCKET: woogles-uploads
IDENTITY_VERIFICATION_UPLOAD_BUCKET: woogles-verifications
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
SKIP_EMAIL_VERIFICATION: 1
RUN_MIGRATIONS: 1
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/`) || PathPrefix(`/gameimg/`) || PathPrefix(`/debug/`) || PathPrefix(`/integrations/`) || PathPrefix(`/embed/`)"
- "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: .
dockerfile: services/socketsrv/Dockerfile-dev
environment:
SECRET_KEY: jqxztripletriple
DEBUG: 1
NATS_URL: nats://nats:4222
FOLLOWERS_CACHE_SIZE: 0
FOLLOWERS_CACHE_TTL: 1m
volumes:
- .:/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: cr.jaegertracing.io/jaegertracing/jaeger:2.12.0
command: ["--config", "/etc/jaeger/config.yaml"]
ports:
- "4317:4317" # OTLP gRPC
- "4318:4318" # OTLP HTTP
- "14250:14250" # Jaeger gRPC
- "14268:14268" # Jaeger HTTP Thrift
volumes:
- ./jaeger-config.yaml:/etc/jaeger/config.yaml:ro
- ./jaeger-ui-config.json:/etc/jaeger/ui-config.json:ro
networks:
- aeronet
labels:
- traefik.enable=true
- "traefik.http.routers.jaeger.rule=Host(`jaeger.localhost`)"
- "traefik.http.routers.jaeger.entrypoints=web"
- "traefik.http.routers.jaeger.priority=200"
- "traefik.http.services.jaeger.loadbalancer.server.port=16686"
proxy:
image: "traefik:v3.6"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=liwords_aeronet"
- "--entrypoints.web.address=:80"
- "--log.level=INFO"
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- aeronet
security_opt:
- no-new-privileges:true
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:17
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
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ROOT_USER: liwords
MINIO_ROOT_PASSWORD: liwords-pass
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
networks:
- aeronet
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 3s
retries: 3
createbuckets:
image: minio/mc
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 liwords liwords-pass;
/usr/bin/mc mb myminio/woogles-uploads --ignore-existing;
/usr/bin/mc anonymous set public myminio/woogles-uploads;
/usr/bin/mc mb myminio/woogles-verifications --ignore-existing;
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 install && npm start"
#command: bash -c "npm install && 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