From 5e340a4cddeb45616ca05e2414e5fd68c1e96990 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 10 Nov 2022 14:13:58 +0100 Subject: [PATCH] fix: expose ports for services --- apps/api/src/lib/services/handlers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index 24a101727..70fdf8315 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -103,7 +103,10 @@ export async function startService(request: FastifyRequest, fa } } } - + let port = null + if (template.services[s].ports?.length > 0) { + port = template.services[s].ports[0] + } config[s] = { container_name: s, build: template.services[s].build || undefined, @@ -111,7 +114,7 @@ export async function startService(request: FastifyRequest, fa entrypoint: template.services[s]?.entrypoint, image: arm ? template.services[s].imageArm : template.services[s].image, expose: template.services[s].ports, - ...(exposePort ? { ports: [`${exposePort}:${exposePort}`] } : {}), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), volumes: Array.from(volumes), environment: newEnvironments, depends_on: template.services[s]?.depends_on,