@dooer/dooer-test-env 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/compose/generate.js +35 -0
- package/package.json +1 -1
package/lib/compose/generate.js
CHANGED
|
@@ -177,6 +177,18 @@ function profilesFor(name) {
|
|
|
177
177
|
return BOOKING_PROFILE_SERVICES.includes(name) ? ['full', 'booking', 'hq'] : ['full']
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
// S3 buckets the services expect (MinIO starts empty; on staging these are OBC-provisioned). Missing ones
|
|
181
|
+
// cause `NoSuchBucket` on document upload / event-stream large-payload offload. The event-stream bucket name
|
|
182
|
+
// is stream-name-derived by the client (`${streamName}-event-stream-large-payloads`). (Jimmy 2026-09-03.)
|
|
183
|
+
const S3_BUCKETS = [
|
|
184
|
+
'file-storage-bucket', // service-file-storage (document blobs)
|
|
185
|
+
'institution-browser-bucket', // service-institution-browser
|
|
186
|
+
`${GLOBAL_OVERRIDES.DOOER_STREAM_NAME}-event-stream-large-payloads`, // @dooer/event-stream large payloads
|
|
187
|
+
's-e032-service-xrays', // service-xrays (DOOER_BUCKET_NAME, a plain manifest value)
|
|
188
|
+
'd-e023-b01-s09-dooer', // DOOER_LEGACY_STORAGE_BUCKET (read fallback)
|
|
189
|
+
'l-e025-b01-s09-dooer', // DOOER_LEGACY_STORAGE_BUCKET_FALLBACK
|
|
190
|
+
]
|
|
191
|
+
|
|
180
192
|
// The infra containers every profile needs (no `profiles:` → always started).
|
|
181
193
|
function infraServices() {
|
|
182
194
|
return {
|
|
@@ -255,6 +267,19 @@ function infraServices() {
|
|
|
255
267
|
volumes: ['minio_data:/data'],
|
|
256
268
|
restart: 'unless-stopped',
|
|
257
269
|
},
|
|
270
|
+
// One-shot: wait for MinIO, then create the buckets the services expect (idempotent). Runs on every `up`.
|
|
271
|
+
'minio-init': {
|
|
272
|
+
image: 'minio/mc:latest',
|
|
273
|
+
platform: 'linux/amd64',
|
|
274
|
+
depends_on: ['minio'],
|
|
275
|
+
entrypoint: [
|
|
276
|
+
'/bin/sh',
|
|
277
|
+
'-c',
|
|
278
|
+
`until mc alias set local http://minio:9000 ${DEV.minioUser} ${DEV.minioPassword} >/dev/null 2>&1; do sleep 1; done; ` +
|
|
279
|
+
`${S3_BUCKETS.map((b) => `mc mb --ignore-existing local/${b}`).join('; ')}; echo minio-init done`,
|
|
280
|
+
],
|
|
281
|
+
restart: 'no',
|
|
282
|
+
},
|
|
258
283
|
// Mutable name→endpoint registry that speaks the Consul health API. Build context is an ABSOLUTE
|
|
259
284
|
// path to the repo's discovery-router, so it resolves no matter where the compose file is written
|
|
260
285
|
// (it lives in ~/.dooer-test-env, not the repo).
|
|
@@ -309,6 +334,13 @@ function rewriteBrowserUrls(env, portMap) {
|
|
|
309
334
|
return env
|
|
310
335
|
}
|
|
311
336
|
|
|
337
|
+
// Legacy service-name aliases the real stack still honours (a service registers/answers under an old name
|
|
338
|
+
// too). We reproduce them as Docker network aliases on the real service's container, so a caller resolving
|
|
339
|
+
// the old name (e.g. via @dooer/service discovery) reaches the right container instead of ENOTFOUND.
|
|
340
|
+
const SERVICE_ALIASES = {
|
|
341
|
+
'service-closing': ['service-periods'], // service-periods is a legacy alias for service-closing (Jimmy 2026-09-03)
|
|
342
|
+
}
|
|
343
|
+
|
|
312
344
|
// Turn the parsed manifests into the compose object.
|
|
313
345
|
function buildCompose(services, frontends, { profile } = {}) {
|
|
314
346
|
const wantedSvc = profile ? services.filter((s) => profilesFor(s.name).includes(profile)) : services
|
|
@@ -327,6 +359,9 @@ function buildCompose(services, frontends, { profile } = {}) {
|
|
|
327
359
|
environment: rewriteBrowserUrls({ ...buildServiceEnv(svc), ...(SERVICE_ENV_OVERRIDES[svc.name] || {}) }, portMap),
|
|
328
360
|
// publish the GraphQL gateway on the host so the frontends' browsers can reach it at localhost
|
|
329
361
|
...(svc.name === 'service-graphql' ? { ports: [`${GATEWAY_HOST_PORT}:3000`] } : {}),
|
|
362
|
+
// legacy-name DNS aliases (e.g. service-periods → service-closing), so callers resolving the old name
|
|
363
|
+
// reach this container on the compose network.
|
|
364
|
+
...(SERVICE_ALIASES[svc.name] ? { networks: { default: { aliases: SERVICE_ALIASES[svc.name] } } } : {}),
|
|
330
365
|
depends_on: ['postgres', 'redis', 'discovery-router'],
|
|
331
366
|
profiles: profilesFor(svc.name),
|
|
332
367
|
restart: 'unless-stopped',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dooer/dooer-test-env",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Run the whole Dooer backend locally (staging DB minus customers), copy/purge customers between environments, and shred — one CLI.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": "Dooer/cli-dooer-test-env",
|