create-seamless 0.0.5 → 0.0.6
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/index.js +32 -13
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -236,11 +236,17 @@ services:
|
|
|
236
236
|
ports:
|
|
237
237
|
- "5432:5432"
|
|
238
238
|
environment:
|
|
239
|
-
POSTGRES_USER:
|
|
240
|
-
POSTGRES_PASSWORD:
|
|
241
|
-
POSTGRES_DB:
|
|
239
|
+
POSTGRES_USER: myuser
|
|
240
|
+
POSTGRES_PASSWORD: mypassword
|
|
241
|
+
POSTGRES_DB: postgres
|
|
242
242
|
volumes:
|
|
243
243
|
- pgdata:/var/lib/postgresql/data
|
|
244
|
+
- ./postgres_init:/docker-entrypoint-initdb.d
|
|
245
|
+
healthcheck:
|
|
246
|
+
test: ["CMD-SHELL", "pg_isready -U myuser -d postgres"]
|
|
247
|
+
interval: 5s
|
|
248
|
+
timeout: 5s
|
|
249
|
+
retries: 5
|
|
244
250
|
|
|
245
251
|
auth:
|
|
246
252
|
container_name: seamless-auth
|
|
@@ -250,13 +256,14 @@ services:
|
|
|
250
256
|
env_file:
|
|
251
257
|
- ./auth/.env
|
|
252
258
|
environment:
|
|
253
|
-
|
|
254
|
-
|
|
259
|
+
DB_HOST: db
|
|
260
|
+
ISSUER=http://auth:${authPort}
|
|
255
261
|
volumes:
|
|
256
262
|
- ./auth:/app
|
|
257
263
|
- /app/node_modules
|
|
258
264
|
depends_on:
|
|
259
|
-
|
|
265
|
+
db:
|
|
266
|
+
condition: service_healthy
|
|
260
267
|
|
|
261
268
|
api:
|
|
262
269
|
container_name: seamless-api
|
|
@@ -266,13 +273,13 @@ services:
|
|
|
266
273
|
env_file:
|
|
267
274
|
- ./api/.env
|
|
268
275
|
environment:
|
|
269
|
-
|
|
276
|
+
AUTH_SERVER_URL=http://auth:${authPort}
|
|
270
277
|
volumes:
|
|
271
278
|
- ./api:/app
|
|
272
279
|
- /app/node_modules
|
|
273
280
|
depends_on:
|
|
274
|
-
|
|
275
|
-
|
|
281
|
+
db:
|
|
282
|
+
condition: service_healthy
|
|
276
283
|
|
|
277
284
|
web:
|
|
278
285
|
container_name: seamless-web
|
|
@@ -358,9 +365,10 @@ async function downloadRepo(repo, dest) {
|
|
|
358
365
|
DEFAULT_ROLES: "user,betaUser",
|
|
359
366
|
AVAILABLE_ROLES: "user,admin,betaUser,team",
|
|
360
367
|
|
|
368
|
+
DB_LOGGING: "false",
|
|
361
369
|
DB_HOST: "localhost",
|
|
362
370
|
DB_PORT: "5432",
|
|
363
|
-
DB_NAME: "
|
|
371
|
+
DB_NAME: "seamless_auth",
|
|
364
372
|
DB_USER: "myuser",
|
|
365
373
|
DB_PASSWORD: "mypassword",
|
|
366
374
|
|
|
@@ -374,7 +382,7 @@ async function downloadRepo(repo, dest) {
|
|
|
374
382
|
JWKS_ACTIVE_KID: "dev-main",
|
|
375
383
|
|
|
376
384
|
RPID: "localhost",
|
|
377
|
-
ORIGINS: `http://localhost:${
|
|
385
|
+
ORIGINS: `http://localhost:${webPort}`,
|
|
378
386
|
});
|
|
379
387
|
}
|
|
380
388
|
|
|
@@ -386,13 +394,14 @@ async function downloadRepo(repo, dest) {
|
|
|
386
394
|
|
|
387
395
|
writeEnv(dir, {
|
|
388
396
|
AUTH_SERVER_URL: `http://localhost:${authPort}`,
|
|
389
|
-
APP_ORIGIN: `http://localhost:${
|
|
397
|
+
APP_ORIGIN: `http://localhost:${apiPort}`,
|
|
398
|
+
UI_ORIGIN: `http://localhost:${webPort}`,
|
|
390
399
|
COOKIE_SIGNING_KEY: randomBytes(32).toString("hex"),
|
|
391
400
|
API_SERVICE_TOKEN: API_SERVICE_TOKEN,
|
|
392
401
|
|
|
393
402
|
DB_HOST: "localhost",
|
|
394
403
|
DB_PORT: "5432",
|
|
395
|
-
DB_NAME: "
|
|
404
|
+
DB_NAME: "seamless_api",
|
|
396
405
|
DB_USER: "myuser",
|
|
397
406
|
DB_PASSWORD: "mypassword",
|
|
398
407
|
|
|
@@ -427,6 +436,16 @@ async function downloadRepo(repo, dest) {
|
|
|
427
436
|
);
|
|
428
437
|
}
|
|
429
438
|
|
|
439
|
+
const pgDir = path.join(root, "postgres_init");
|
|
440
|
+
fs.mkdirSync(pgDir);
|
|
441
|
+
fs.writeFileSync(
|
|
442
|
+
path.join(pgDir, "init.sql"),
|
|
443
|
+
`
|
|
444
|
+
CREATE DATABASE seamless_auth;
|
|
445
|
+
CREATE DATABASE seamless_api;
|
|
446
|
+
`,
|
|
447
|
+
);
|
|
448
|
+
|
|
430
449
|
console.log(`
|
|
431
450
|
╔════════════════════════════════════════╗
|
|
432
451
|
║ S E A M L E S S ║
|