diff --git a/src/routes/applications/[id]/index.svelte b/src/routes/applications/[id]/index.svelte index ea07637bd..aec49c09a 100644 --- a/src/routes/applications/[id]/index.svelte +++ b/src/routes/applications/[id]/index.svelte @@ -527,7 +527,8 @@
!isRunning && changeSettings('dualCerts')} />
-
- { - showExposePort = !showExposePort; - service.exposePort = undefined; - }} - title={$t('application.expose_a_port')} - description="Expose a port to the host system" +
+ + +
Useful if you would like to use your own reverse proxy or tunnel and also in development mode. Otherwise leave empty.'} />
- {#if showExposePort} -
- - -
- {/if} - {#if service.type === 'plausibleanalytics'} {:else if service.type === 'minio'} diff --git a/src/routes/services/[id]/fider/start.json.ts b/src/routes/services/[id]/fider/start.json.ts index 812497620..51e45ec3f 100644 --- a/src/routes/services/[id]/fider/start.json.ts +++ b/src/routes/services/[id]/fider/start.json.ts @@ -13,6 +13,7 @@ import { ErrorHandler, getServiceImage } from '$lib/database'; import { makeLabelForServices } from '$lib/buildPacks/common'; import type { ComposeFile } from '$lib/types/composeFile'; import type { Service, DestinationDocker, Prisma } from '@prisma/client'; +import { getServiceMainPort } from '$lib/components/common'; export const post: RequestHandler = async (event) => { const { teamId, status, body } = await getUserDetails(event); @@ -30,6 +31,7 @@ export const post: RequestHandler = async (event) => { destinationDockerId, destinationDocker, serviceSecret, + exposePort, fider: { postgresqlUser, postgresqlPassword, @@ -48,6 +50,7 @@ export const post: RequestHandler = async (event) => { } = service; const network = destinationDockerId && destinationDocker.network; const host = getEngine(destinationDocker.engine); + const port = getServiceMainPort('fider'); const { workdir } = await createDirectories({ repository: type, buildId: id }); const image = getServiceImage(type); @@ -97,6 +100,7 @@ export const post: RequestHandler = async (event) => { volumes: [], restart: 'always', labels: makeLabelForServices('fider'), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), deploy: { restart_policy: { condition: 'on-failure', diff --git a/src/routes/services/[id]/hasura/start.json.ts b/src/routes/services/[id]/hasura/start.json.ts index 325d6e33c..8a8cc3f04 100644 --- a/src/routes/services/[id]/hasura/start.json.ts +++ b/src/routes/services/[id]/hasura/start.json.ts @@ -7,6 +7,7 @@ import { ErrorHandler, getServiceImage } from '$lib/database'; import { makeLabelForServices } from '$lib/buildPacks/common'; import type { ComposeFile } from '$lib/types/composeFile'; import type { Service, DestinationDocker, Prisma } from '@prisma/client'; +import { getServiceMainPort } from '$lib/components/common'; export const post: RequestHandler = async (event) => { const { teamId, status, body } = await getUserDetails(event); @@ -23,10 +24,12 @@ export const post: RequestHandler = async (event) => { destinationDockerId, destinationDocker, serviceSecret, + exposePort, hasura: { postgresqlUser, postgresqlPassword, postgresqlDatabase } } = service; const network = destinationDockerId && destinationDocker.network; const host = getEngine(destinationDocker.engine); + const port = getServiceMainPort('hasura'); const { workdir } = await createDirectories({ repository: type, buildId: id }); const image = getServiceImage(type); @@ -65,6 +68,7 @@ export const post: RequestHandler = async (event) => { volumes: [], restart: 'always', labels: makeLabelForServices('hasura'), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), deploy: { restart_policy: { condition: 'on-failure', diff --git a/src/routes/services/[id]/minio/start.json.ts b/src/routes/services/[id]/minio/start.json.ts index 3782bf467..0c93eb3ce 100644 --- a/src/routes/services/[id]/minio/start.json.ts +++ b/src/routes/services/[id]/minio/start.json.ts @@ -65,7 +65,7 @@ export const post: RequestHandler = async (event) => { networks: [network], volumes: [config.volume], restart: 'always', - ...(exposePort && { ports: [`${port}:${port}`] }), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), labels: makeLabelForServices('minio'), deploy: { restart_policy: { diff --git a/src/routes/services/[id]/n8n/start.json.ts b/src/routes/services/[id]/n8n/start.json.ts index cca55b61e..073fede9b 100644 --- a/src/routes/services/[id]/n8n/start.json.ts +++ b/src/routes/services/[id]/n8n/start.json.ts @@ -48,6 +48,7 @@ export const post: RequestHandler = async (event) => { environment: config.environmentVariables, restart: 'always', labels: makeLabelForServices('n8n'), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), deploy: { restart_policy: { condition: 'on-failure', diff --git a/src/routes/services/[id]/plausibleanalytics/start.json.ts b/src/routes/services/[id]/plausibleanalytics/start.json.ts index 8adce773a..81c8f2bd8 100644 --- a/src/routes/services/[id]/plausibleanalytics/start.json.ts +++ b/src/routes/services/[id]/plausibleanalytics/start.json.ts @@ -135,7 +135,7 @@ COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`; networks: [network], environment: config.plausibleAnalytics.environmentVariables, restart: 'always', - ...(exposePort && { ports: [`${port}:${exposePort}`] }), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), depends_on: [`${id}-postgresql`, `${id}-clickhouse`], labels: makeLabelForServices('plausibleAnalytics'), deploy: { @@ -195,6 +195,7 @@ COPY ./init-db.sh /docker-entrypoint-initdb.d/init-db.sh`; } }; const composeFileDestination = `${workdir}/docker-compose.yaml`; + console.log(JSON.stringify(composeFile, null, 2)); await fs.writeFile(composeFileDestination, yaml.dump(composeFile)); await asyncExecShell(`DOCKER_HOST=${host} docker compose -f ${composeFileDestination} pull`); await asyncExecShell( diff --git a/src/routes/services/[id]/umami/start.json.ts b/src/routes/services/[id]/umami/start.json.ts index c2cd78fe4..7ba5547ed 100644 --- a/src/routes/services/[id]/umami/start.json.ts +++ b/src/routes/services/[id]/umami/start.json.ts @@ -159,7 +159,7 @@ export const post: RequestHandler = async (event) => { networks: [network], volumes: [], restart: 'always', - ...(exposePort ? { ports: [`${port}:${port}`] } : {}), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), labels: makeLabelForServices('umami'), deploy: { restart_policy: { diff --git a/src/routes/services/[id]/vscodeserver/start.json.ts b/src/routes/services/[id]/vscodeserver/start.json.ts index 1501a43c6..ba9807f12 100644 --- a/src/routes/services/[id]/vscodeserver/start.json.ts +++ b/src/routes/services/[id]/vscodeserver/start.json.ts @@ -78,7 +78,7 @@ export const post: RequestHandler = async (event) => { networks: [network], volumes: [config.volume, ...volumes], restart: 'always', - ...(exposePort ? { ports: [`${port}:${exposePort}`] } : {}), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), labels: makeLabelForServices('vscodeServer'), deploy: { restart_policy: { diff --git a/src/routes/services/[id]/wordpress/start.json.ts b/src/routes/services/[id]/wordpress/start.json.ts index 43bab2e9d..df16d16bc 100644 --- a/src/routes/services/[id]/wordpress/start.json.ts +++ b/src/routes/services/[id]/wordpress/start.json.ts @@ -79,7 +79,7 @@ export const post: RequestHandler = async (event) => { volumes: [config.wordpress.volume], networks: [network], restart: 'always', - ...(exposePort ? { ports: [`${port}:${port}`] } : {}), + ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}), depends_on: [`${id}-mysql`], labels: makeLabelForServices('wordpress'), deploy: {