-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (68 loc) · 2.61 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (68 loc) · 2.61 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
name: portal-service
services:
# One-shot directory seed: hr_employee + a users stand-in in the portal DB so
# the ListEmployees $lookup (hr_employee × users on {account, siteId}) resolves
# the demo accounts. They match the ones tools/seed-sample-data creates.
portal-seed:
image: mongo:8.2.9
entrypoint:
- mongosh
- --host
- mongodb
- --quiet
- --eval
- |
const p = db.getSiblingDB('portal');
[['alice', 'E001'], ['bob', 'E002']].forEach(([account, employeeId]) => {
p.hr_employee.replaceOne(
{ account: account },
{ account: account, employeeId: employeeId, siteId: 'site-local', natsUrl: 'ws://localhost:9222' },
{ upsert: true },
);
p.users.replaceOne(
{ account: account, siteId: 'site-local' },
{ _id: 'u-' + account, account: account, siteId: 'site-local' },
{ upsert: true },
);
});
// Public settings exposed via GET /api/settings.public (allowlisted below).
// Only low-sensitivity operational config belongs here — it is served unauthenticated.
p.settings.replaceOne(
{ _id: 'otel.url' },
{ _id: 'otel.url', value: 'http://localhost:4318', public: true, hidden: false },
{ upsert: true },
);
print('portal seed: hr_employee=' + p.hr_employee.countDocuments() + ' users=' + p.users.countDocuments() + ' settings=' + p.settings.countDocuments());
networks:
- chat-local
portal-service:
build:
context: ../..
dockerfile: portal-service/deploy/Dockerfile
pull_policy: build
depends_on:
portal-seed:
condition: service_completed_successfully
ports:
- "8081:8081"
env_file:
- path: ../../docker-local/.env
required: false
environment:
- PORT=8081
# Dev fallback: accounts absent from the directory resolve to the local site.
- DEV_MODE=${DEV_MODE:-true}
- PORTAL_DEV_FALLBACK_SITE_ID=site-local
- PORTAL_DEV_FALLBACK_NATS_URL=ws://localhost:9222
# Per-site URL registry (JSON): siteId -> {authServiceUrl, baseUrl}.
# baseUrl is the site's own origin, distinct from the auth-service URL.
- 'PORTAL_SITE_URLS={"site-local":{"authServiceUrl":"http://localhost:8080","baseUrl":"http://localhost:3000"}}'
- MONGO_URI=mongodb://mongodb:27017
- MONGO_DB=portal
# Default-deny allowlist of setting _ids exposable via GET /api/settings.public.
- PORTAL_PUBLIC_SETTINGS_KEYS=otel.url
networks:
- chat-local
networks:
chat-local:
external: true