-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
282 lines (270 loc) · 8.26 KB
/
Copy pathdocker-compose.yml
File metadata and controls
282 lines (270 loc) · 8.26 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
279
280
281
282
# Before running docker compose --profile postgres up for the first time,
# first copy the env.example file to .env and fill in the values.
# `cp env.example .env`
# (edit values as needed)
#
# Then, build and run with:
# `docker compose --profile postgres build`
# `docker compose --profile postgres up`
#
# Subsequently you should only need to run:
# `docker compose --profile postgres up`
#
# Force a full re-build with no cache from previous builds:
# `docker compose --profile postgres build --no-cache`
# `docker compose --profile postgres up`
#
# If you only changed the .env file, you can do a quick rebuild:
# `docker compose --profile postgres up --force-recreate`
#
# To stop, press CTRL+C (if not running in --detach mode), or run:
# `docker compose --profile postgres down`
#
# omit the --profile postgres flag to run without the postgres service,
# such as when using postgres on your host machine, or a remote server.
# (by default, the Makefile will include --profile postgres, unless POSTGRES_DOCKER=false in your env)
services:
client-participation-alpha:
build:
context: ./client-participation-alpha
dockerfile: Dockerfile
args:
- PUBLIC_SERVICE_URL=${PUBLIC_SERVICE_URL}
- INTERNAL_SERVICE_URL=${INTERNAL_SERVICE_URL}
- OIDC_CACHE_KEY_PREFIX=${OIDC_CACHE_KEY_PREFIX}
- OIDC_CACHE_KEY_ID_TOKEN_SUFFIX=${OIDC_CACHE_KEY_ID_TOKEN_SUFFIX}
container_name: client-participation-alpha
restart: unless-stopped
networks:
- "polis-net"
ports:
- "4321:4321"
environment:
- PUBLIC_SERVICE_URL=${PUBLIC_SERVICE_URL}
- INTERNAL_SERVICE_URL=${INTERNAL_SERVICE_URL}
- PUBLIC_OIDC_CACHE_KEY_PREFIX=${OIDC_CACHE_KEY_PREFIX}
- PUBLIC_OIDC_CACHE_KEY_ID_TOKEN_SUFFIX=${OIDC_CACHE_KEY_ID_TOKEN_SUFFIX}
depends_on:
- "server"
server:
environment:
- DATABASE_URL=${DATABASE_URL}
- DATABASE_SSL=${DATABASE_SSL}
env_file:
- ${SERVER_ENV_FILE:-.env}
image: 050917022930.dkr.ecr.us-east-1.amazonaws.com/polis/server:latest
build:
context: ./server
dockerfile: Dockerfile
target: prod
args:
NODE_ENV: production
labels:
polis_tag: ${TAG:-dev}
networks:
- "polis-net"
# Scale the server container to a given number of instances.
scale: 1
volumes:
# Persist logs to a volume, so they can be accessed after the container is stopped.
- server-logs:/app/logs
# Sync data for identity cron
- ./data:/app/data:ro
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
math:
image: 050917022930.dkr.ecr.us-east-1.amazonaws.com/polis/math:latest
build:
context: ./math
labels:
polis_tag: ${TAG:-dev}
environment:
- DATABASE_URL=${DATABASE_URL}
- LOGGING_LEVEL=${MATH_LOG_LEVEL:-warn}
- MATH_ENV=${MATH_ENV:-prod}
- WEBSERVER_USERNAME=${WEBSERVER_USERNAME}
- WEBSERVER_PASS=${WEBSERVER_PASS}
# Database connection pool configuration for math service
- DATABASE_POOL_SIZE=${MATH_DATABASE_POOL_SIZE:-10}
networks:
- "polis-net"
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
delphi:
image: 050917022930.dkr.ecr.us-east-1.amazonaws.com/polis/delphi:latest
build:
context: ./delphi
labels:
polis_tag: ${TAG:-dev}
environment:
- DATABASE_URL=${DATABASE_URL}
- LOG_LEVEL=${DELPHI_LOG_LEVEL:-INFO}
- DELPHI_DEV_OR_PROD=${DELPHI_DEV_OR_PROD:-prod}
# DynamoDB connection settings for local mode (will be overridden in prod)
- DYNAMODB_ENDPOINT=${DYNAMODB_ENDPOINT}
- POLL_INTERVAL=${POLL_INTERVAL:-2}
# Ollama connection
- OLLAMA_HOST=${OLLAMA_HOST}
- OLLAMA_MODEL=${OLLAMA_MODEL}
# AWS environment variables (will be provided in prod)
- AWS_REGION=${AWS_REGION:-us-east-1}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
# S3 storage for visualization files
- AWS_S3_ENDPOINT=${AWS_S3_ENDPOINT}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-minioadmin}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-minioadmin}
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-polis-delphi}
# API keys for LLM services
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
- ANTHROPIC_MODEL=${ANTHROPIC_MODEL:-}
# PostgreSQL connection details for scripts that use them directly
- DATABASE_HOST=${POSTGRES_HOST}
- DATABASE_PORT=${POSTGRES_PORT}
- DATABASE_NAME=${POSTGRES_DB}
- DATABASE_USER=${POSTGRES_USER:-christian}
- DATABASE_PASSWORD=${POSTGRES_PASSWORD:-polis123}
- DATABASE_SSL_MODE=${DATABASE_SSL_MODE:-disable}
- NUMBA_DISABLE_JIT=${NUMBA_DISABLE_JIT:-1}
- INSTANCE_SIZE=${INSTANCE_SIZE:-default}
networks:
- "polis-net"
extra_hosts:
- "host.docker.internal:host-gateway"
deploy:
resources:
limits:
memory: ${DELPHI_CONTAINER_MEMORY:-16g}
cpus: ${DELPHI_CONTAINER_CPUS:-2}
restart: unless-stopped
postgres:
restart: always
build:
context: ./server
dockerfile: Dockerfile-db
labels:
polis_tag: ${TAG:-dev}
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
networks:
- "polis-net"
volumes:
- "backups:/backups"
- "postgres:/var/lib/postgresql/data"
profiles:
- postgres
nginx-proxy:
image: docker.io/compdem/polis-nginx-proxy:${TAG:-dev}
build:
context: ./file-server
dockerfile: nginx.Dockerfile
labels:
polis_tag: ${TAG:-dev}
environment:
- API_SERVER_PORT=${API_SERVER_PORT:-5000}
depends_on:
- "client-participation-alpha"
- "server"
networks:
- "polis-net"
ports:
- ${HTTP_PORT:-80}:80
- ${HTTPS_PORT:-443}:443
file-server:
image: docker.io/compdem/polis-file-server:${TAG:-dev}
build:
context: ./
dockerfile: file-server/Dockerfile
args:
AUTH_AUDIENCE: ${AUTH_AUDIENCE}
AUTH_CLIENT_ID: ${AUTH_CLIENT_ID}
AUTH_ISSUER: ${AUTH_ISSUER}
EMBED_SERVICE_HOSTNAME: ${EMBED_SERVICE_HOSTNAME}
GA_TRACKING_ID: ${GA_TRACKING_ID}
GIT_HASH: "${GIT_HASH:-placeholder}"
NODE_ENV: production
OIDC_CACHE_KEY_PREFIX: ${OIDC_CACHE_KEY_PREFIX}
OIDC_CACHE_KEY_ID_TOKEN_SUFFIX: ${OIDC_CACHE_KEY_ID_TOKEN_SUFFIX}
labels:
polis_tag: ${TAG:-dev}
environment:
- PORT=${STATIC_FILES_PORT:-8080}
networks:
- "polis-net"
dynamodb:
image: amazon/dynamodb-local:latest
container_name: polis-dynamodb-local
ports:
- "8000:8000"
networks:
- "polis-net"
# Persistent storage instead of in-memory
command: "-jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data"
volumes:
- dynamodb-data:/home/dynamodblocal/data
environment:
- JAVA_OPTS=-Xmx1G
user: root
labels:
polis_tag: ${TAG:-dev}
profiles:
- local-services
# Ollama for LLM processing
ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama-models:/root/.ollama
networks:
- "polis-net"
# Run ollama server
command: serve
restart: unless-stopped
# MinIO S3-compatible storage
minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data:/data
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
# Setup for auto-bucket creation with public read access
MINIO_BROWSER_REDIRECT_URL: http://localhost:9001
MINIO_DOMAIN: localhost
# Allow public policy to be set
MINIO_BROWSER: "on"
command: server /data --console-address ":9001"
networks:
- "polis-net"
profiles:
- local-services
networks:
polis-net:
volumes:
backups:
labels:
polis_tag: ${TAG:-dev}
postgres:
labels:
polis_tag: ${TAG:-dev}
server-logs:
labels:
polis_tag: ${TAG:-dev}
dynamodb-data:
labels:
polis_tag: ${TAG:-dev}
ollama-models:
labels:
polis_tag: ${TAG:-dev}
minio_data:
labels:
polis_tag: ${TAG:-dev}