From a663c14df816ce685d14140f0ddc1d8aec58774c Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 22 Nov 2022 10:47:02 +0100 Subject: [PATCH] fix: exposed ports --- apps/api/src/lib/services/handlers.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/api/src/lib/services/handlers.ts b/apps/api/src/lib/services/handlers.ts index b07245940..270cce2cf 100644 --- a/apps/api/src/lib/services/handlers.ts +++ b/apps/api/src/lib/services/handlers.ts @@ -113,7 +113,9 @@ export async function startService(request: FastifyRequest, fa } else { if (template.services[s].ports?.length === 1) { for (const port of template.services[s].ports) { - ports.push(`${exposePort}:${exposePort}`) + if (exposePort) { + ports.push(`${exposePort}:${port}`) + } } } } @@ -128,7 +130,7 @@ export async function startService(request: FastifyRequest, fa entrypoint: template.services[s]?.entrypoint, image, expose: template.services[s].ports, - ports, + ports: ports.length > 0 ? ports : undefined, volumes: Array.from(volumes), environment: newEnvironments, depends_on: template.services[s]?.depends_on,