-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
173 lines (164 loc) · 8.74 KB
/
docker-compose.yaml
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
version: "3.9"
services:
frontend:
image: ghcr.io/world-wide-weights/frontend:main
restart: "always"
ports:
- 3000:3000
environment:
- NEXT_PUBLIC_CLIENT_BASE_URL=${NEXT_PUBLIC_CLIENT_BASE_URL:-http://localhost:3000}
- NEXT_PUBLIC_API_BASE_URL_QUERY_SERVER=${NEXT_PUBLIC_API_BASE_URL_QUERY_SERVER:-http://query:3004/queries/v1}
- NEXT_PUBLIC_API_BASE_URL_QUERY_CLIENT=${NEXT_PUBLIC_API_BASE_URL_QUERY_CLIENT:-http://localhost:3004/queries/v1}
- NEXT_PUBLIC_API_BASE_URL_COMMAND=${NEXT_PUBLIC_API_BASE_URL_COMMAND:-http://localhost:3002/commands/v1}
- NEXT_PUBLIC_API_BASE_URL_AUTH_SERVER=${NEXT_PUBLIC_API_BASE_URL_AUTH_SERVER:-http://auth:3001}
- NEXT_PUBLIC_API_BASE_URL_AUTH_CLIENT=${NEXT_PUBLIC_API_BASE_URL_AUTH_CLIENT:-http://localhost:3001}
- NEXT_PUBLIC_API_BASE_URL_IMAGE_SERVER=${NEXT_PUBLIC_API_BASE_URL_IMAGE_SERVER:-http://img:3003}
- NEXT_PUBLIC_API_BASE_URL_IMAGE_CLIENT=${NEXT_PUBLIC_API_BASE_URL_IMAGE_CLIENT:-http://localhost:3003}
links:
- command-backend:cmd
- query-backend:query
- auth-backend:auth
- image-backend:img
auth-backend:
image: ghcr.io/world-wide-weights/auth-backend:main
restart: "always"
ports:
- 3001:3001
environment:
- NODE_ENV=${DOCKER_NODE_ENV:-development}
- DB_HOST=${AUTH_DB_HOST:-pg}
- DB_PORT=${AUTH_DB_PORT:-5432}
- DB_DB=${AUTH_DB_DB:-auth}
- DB_USER=${AUTH_DB_USER:-admin}
- DB_PW=${AUTH_DB_PW:-admin}
- MAIL_HOST=${AUTH_MAIL_HOST:-smtp.ethereal.email}
- MAIL_PORT=${AUTH_MAIL_PORT:-587}
- MAIL_USERNAME=${AUTH_MAIL_USERNAME:[email protected]}
- MAIL_PASSWORD=${AUTH_MAIL_PASSWORD:-eCthbsb1DezensDnFf}
- MAIL_MAX_RETRIES=${AUTH_MAIL_MAX_RETRIES:-5}
- MAIL_ERROR_DELAY=${AUTH_MAIL_ERROR_DELAY_MS:-100}
- MAIL_ADDRESS=${AUTH_MAIL_ADDRESS:[email protected]}
- JWT_EXPIRE_TIME=${AUTH_JWT_EXPIRE_TIME:-15m}
- JWT_REFRESH_EXPIRE_TIME=${AUTH_JWT_REFRESH_EXPIRE_TIME:-10h}
- JWT_PRIVATE_KEY=${AUTH_JWT_PRIVATE_KEY:-"-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAl3MdIsdaQQVGaEbyWCet4sHcjsXQ4l56RN0YKqXNgyqFLEHM\ntEdRrlpFbFcDIwQtSWeDldZTali6R/z3Z+cX+7SGVw3/+7syPYerPfVbGQlIoNNv\nhXNH0uXxn8iKPykAIsK09zkmop+8Sg6SCBiVQ43gFNg/7noqec4n9+ectVUZg3AV\ntfHVJXQjc9yI2X3eD5/wAuMcdYjps2ZEj/dv2VyFEkZWX1IS+cgGxx2LO0IYTQSr\nQyOrL3fjOloH74ChQAE/ampTG2aVOz3bXEtaogyjpl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w\nmisCGRSUXE/w0IQ5qeGPYSvaul6Vcu+HPK09oIFIF2ZW+ZlvDLj9cl4k9qgcrM8V\n7cSPAoGBALv8PgLDZWHgeLz7nGmK1N8ejcL2JSo+zyoLNIea4C/lkWi2dPoyucF0\nP6wF4i7vk5rN4EQPz2yESlbppzs3l1bHFZ21sN1cuc4rM+ZQf+LhmoIHzDvSGalq\nPWVQlnWphdMWwXwWV+sgvCQWET1Qs7Ll1R7v7z5p8LrQpvImingP\n-----END RSA PRIVATE KEY-----"}
- JWT_PUBLIC_KEY=${AUTH_JWT_PUBLIC_KEY:-"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAl3MdIsdaQQVGaEbyWCet\n4sHcjsXQ4l56RN0YKqXNgyqFLEHMtEdRrlpFbFcDIwQtSWeDldZTali6R/z3Z+cX\n+7SGVw3/+7syPYerPfVbGQlIoNNvhXNH0uXxn8iKPykAIsK09zkmop+8Sg6SCBiV\nQ43gFNg/7noqec4n9+ectVUZg3AVtfHVJXQjc9yI2X3eD5/wAuMcdYjps2ZEj/dv\n2VyFEkZWX1IS+cgGxx2LO0IYTQSrQyOrL3fjOloH74ChQAE/ampTG2aVOz3bXEta\nogyjplf0cdwbM+qib2god8TNFhMnmtjoFIOdK2UwB1Fyy8kVoCffDDPNn+YhygAF\nrwIDAQAB\n-----END PUBLIC KEY-----"}
- JWT_AUTH_KID=${AUTH_JWT_AUTH_KID:-auth-base-key}
- API_KEYS=${AUTH_API_KEYS:-cmd,img,qry}
links:
- postgres:pg
command-backend:
image: ghcr.io/world-wide-weights/command-backend:main
restart: "always"
ports:
- 3002:3002
environment:
- NODE_ENV=${DOCKER_NODE_ENV:-development}
- DB_MONGO_HOST=${CMD_DB_MONGO_HOST:-mongo}
- DB_MONGO_PORT=${CMD_DB_MONGO_PORT:-27017}
- DB_MONGO_USER=${CMD_DB_MONGO_USER:-admin}
- DB_MONGO_PW=${CMD_DB_MONGO_PW:-admin}
- DB_MONGO_NAME=${CMD_DB_MONGO_NAME:-wwweights}
- DB_EVENTSTORE_HOST=${CMD_DB_EVENTSTORE_HOST:-eventstore:2113}
- DB_EVENTSTORE_USERNAME=${CMD_DB_EVENTSTORE_USERNAME:-ops}
- DB_EVENTSTORE_PW=${CMD_DB_EVENTSTORE_PW:-changeit}
- DB_EVENTSTORE_USE_TLS=${CMD_DB_EVENTSTORE_USE_TLS:-false}
- JWKS_AUTH_URL=${CMD_JWKS_AUTH_URL:-http://auth:3001/auth/.well-known/jwks.json}
- SKIP_READ_DB_REBUILD=${CMD_SKIP_READ_DB_REBUILD:-true}
- AUTH_API_KEY=${CMD_AUTH_API_KEY:-cmd}
- IMG_BACKEND_BASE_URL=${CMD_IMG_BACKEND_BASE_URL:-http://img:3003}
- IMG_API_KEY=${CMD_IMG_API_KEY:-cmd}
links:
- auth-backend:auth
- eventstore:eventstore
- mongodb:mongo
- image-backend:img
image-backend:
image: ghcr.io/world-wide-weights/image-backend:main
restart: "always"
ports:
- 3003:3003
environment:
- NODE_ENV=${DOCKER_NODE_ENV:-development}
- JWKS_AUTH_URL=${IMG_JWKS_AUTH_URL:-http://auth:3001/auth/.well-known/jwks.json}
- AUTH_BACKEND_BASE_URL=${IMG_AUTH_BACKEND_BASE_URL:-http://auth:3001}
- IMAGE_STORE_BASE_PATH=${IMG_IMAGE_STORE_BASE_PATH:-/app/data}
- IMAGE_STORE_INCOMING_CACHE_PATH=${IMG_IMAGE_STORE_INCOMING_CACHE_PATH:-./cache}
- AUTH_API_KEY=${IMG_AUTH_API_KEY:-img}
- API_KEYS=${IMG_API_KEYS:-cmd}
volumes:
- ./backend/docker-images:${IMG_IMAGE_STORE_BASE_PATH:-/app/data}
links:
- auth-backend:auth
query-backend:
image: ghcr.io/world-wide-weights/query-backend:main
restart: "always"
ports:
- 3004:3004
environment:
- NODE_ENV=${DOCKER_NODE_ENV:-development}
- DB_MONGO_HOST=${QRY_DB_MONGO_HOST:-mongo}
- DB_MONGO_PORT=${QRY_DB_MONGO_PORT:-27017}
- DB_MONGO_USER=${QRY_DB_MONGO_USER:-mongo}
- DB_MONGO_PW=${QRY_DB_MONGO_PW:-mongo}
- DB_MONGO_NAME=${QRY_DB_MONGO_NAME:-wwweights}
- JWKS_AUTH_URL=${QRY_JWKS_AUTH_URL:-http://auth:3001/auth/.well-known/jwks.json}
- AUTH_API_KEY=${QRY_AUTH_API_KEY:-qry}
links:
- mongodb:mongo
mongodb:
image: mongo:6.0.3
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_MONGO_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${DB_MONGO_PW:-admin}
MONGO_INITDB_DATABASE: ${DB_MONGO_NAME:-wwweights}
ports:
- 27018:27017
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet
interval: 30s
timeout: 10s
retries: 3
restart: "always"
volumes:
- mongodb_data_volume:/data/mongodb
eventstore:
image: eventstore/eventstore:${EVENTSTORE_ARM_TAG:-22.10.0-buster-slim}
restart: "always"
ports:
# Web admin ui
- 1114:${EVENTSTORE_EXT_TCP_PORT:-1113}
# Actual db connection endpoint
- 2114:${EVENTSTORE_HTTP_PORT:-2113}
volumes:
- eventstore_data_volume:/var/lib/eventstore
environment:
- EVENTSTORE_CLUSTER_SIZE=${EVENTSTORE_CLUSTER_SIZE:-1}
- EVENTSTORE_RUN_PROJECTIONS=${EVENTSTORE_RUN_PROJECTIONS:-All}
- EVENTSTORE_START_STANDARD_PROJECTIONS=${EVENTSTORE_START_STANDARD_PROJECTIONS:-true}
- EVENTSTORE_EXT_TCP_PORT=${EVENTSTORE_EXT_TCP_PORT:-1113}
- EVENTSTORE_HTTP_PORT=${EVENTSTORE_HTTP_PORT:-2113}
- EVENTSTORE_INSECURE=${EVENTSTORE_INSECURE:-true}
- EVENTSTORE_ENABLE_EXTERNAL_TCP=${EVENTSTORE_ENABLE_EXTERNAL_TCP:-true}
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=${EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP:-true}
postgres:
image: postgres:15
restart: "always"
volumes:
- postgres_data_volume:/var/lib/pgsql/data
- ./db/setup:/docker-entrypoint-initdb.d/
ports:
- 5433:5432
environment:
- POSTGRES_USER=${DB_PG_USER:-admin}
- POSTGRES_PASSWORD=${DB_PG_PW:-admin}
- POSTGRES_DB=${DB_PG_DB:-auth}
healthcheck:
# TODO: This can be replaced by a more accurate healthcheck based on PID 1
test: ["CMD-SHELL", "pg_isready"]
interval: 60s
timeout: 5s
retries: 3
volumes:
mongodb_data_volume:
postgres_data_volume:
eventstore_data_volume: