Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: next/nuxt deployment type

Andras Bacsaid7fd1fc65bb7
diff --git a/apps/api/src/routes/api/v1/applications/handlers.ts b/apps/api/src/routes/api/v1/applications/handlers.ts
index cb0bf38fee..1dda22dc5a 100644
--- a/apps/api/src/routes/api/v1/applications/handlers.ts
+++ b/apps/api/src/routes/api/v1/applications/handlers.ts
@@ -34,7 +34,7 @@ export async function getImages(request: FastifyRequest<GetImages>) {
const { buildPack, deploymentType } = request.body
let publishDirectory = undefined;
let port = undefined
- const { baseImage, baseBuildImage, baseBuildImages, baseImages, } = setDefaultBaseImage(
+ const { baseImage, baseBuildImage, baseBuildImages, baseImages } = setDefaultBaseImage(
buildPack, deploymentType
);
if (buildPack === 'nextjs') {
@@ -56,8 +56,7 @@ export async function getImages(request: FastifyRequest<GetImages>) {
}
}
-
- return { baseBuildImage, baseBuildImages, publishDirectory, port }
+ return { baseImage, baseImages, baseBuildImage, baseBuildImages, publishDirectory, port }
} catch ({ status, message }) {
return errorHandler({ status, message })
}
@@ -232,7 +231,6 @@ export async function saveApplication(request: FastifyRequest<SaveApplication>,
baseBuildImage,
deploymentType
} = request.body
-
if (port) port = Number(port);
if (exposePort) {
exposePort = Number(exposePort);
diff --git a/apps/ui/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelte
index 9ef2e5612f..b54f277479 100644
--- a/apps/ui/src/routes/applications/[id]/index.svelte
+++ b/apps/ui/src/routes/applications/[id]/index.svelte
@@ -114,10 +114,30 @@
buildPack: application.buildPack,
deploymentType: application.deploymentType
});
- application = {
- ...application,
- ...data
- };
+ const baseImageCorrect = data.baseImages.filter(
+ (image: any) => image.value === application.baseImage
+ );
+ if (baseImageCorrect.length === 0) {
+ application.baseImage = data.baseImage;
+ }
+ application.baseImages = data.baseImages;
+
+ const baseBuildImageCorrect = data.baseBuildImages.filter(
+ (image: any) => image.value === application.baseBuildImage
+ );
+ if (baseBuildImageCorrect.length === 0) {
+ application.baseBuildImage = data.baseBuildImage;
+ }
+ application.baseBuildImages = data.baseBuildImages;
+ if (application.deploymentType === 'static' && application.port !== '80') {
+ application.port = data.port;
+ }
+ if (application.deploymentType === 'node' && application.port === '80') {
+ application.port = data.port;
+ }
+ if (!application.publishDirectory) {
+ application.publishDirectory = data.publishDirectory;
+ }
}
async function changeSettings(name: any) {
if (name === 'debug') {
@@ -631,9 +651,7 @@
bind:value={application.port}
placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
/>
- <Explainer
- text={'The port your application listens on.'}
- />
+ <Explainer text={'The port your application listens on.'} />
</div>
{/if}
<div class="grid grid-cols-2 items-center">