Skip to content

Commit

Permalink
fix: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yuaanlin committed Nov 29, 2023
1 parent 557aa0e commit 79d4025
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 4 additions & 0 deletions internal/nodejs/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func TestGetContextBasedOnMeta_WithOutputdirAndSPAFramework(t *testing.T) {
InstallCmd: "RUN npm install",
BuildCmd: "npm run build",
StartCmd: "npm run start",
Framework: "wtfisthis",
OutputDir: "dist",
})
}

Expand All @@ -57,5 +59,7 @@ func TestGetContextBasedOnMeta_WithOutputdirAndMPAFramework(t *testing.T) {
InstallCmd: "RUN npm install",
BuildCmd: "npm run build",
StartCmd: "npm run start",
Framework: "hexo",
OutputDir: "dist",
})
}
12 changes: 1 addition & 11 deletions internal/nodejs/templates/template.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,17 @@ RUN corepack enable && corepack prepare --all
{{ .InstallCmd }}

COPY . .

{{ if and (eq .Framework "nuxt.js") .Serverless }}
ENV NITRO_PRESET=node
{{ end }}

# Build if we can build it
{{ if .BuildCmd }}RUN {{ .BuildCmd }}{{ end }}

{{ if .Serverless }}

FROM scratch as output
COPY --from=build /src /

{{ else if ne .OutputDir "" }}

FROM scratch as output
COPY --from=build /src/{{ .OutputDir }} /

{{ else }}

EXPOSE 8080
CMD {{ .StartCmd }}

{{ end }}
CMD {{ .StartCmd }}{{ end }}

0 comments on commit 79d4025

Please sign in to comment.