-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
ARG NODE_VERSION=22.5.1 | ||
|
||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
ARG PORT=3000 | ||
|
||
ENV NODE_ENV=production | ||
|
||
WORKDIR /src | ||
|
||
# Build | ||
FROM base as build | ||
|
||
COPY --link package.json package-lock.json ./ | ||
RUN npm install --production=false | ||
|
||
COPY --link . . | ||
|
||
RUN npm run build | ||
RUN npm prune | ||
|
||
# Run | ||
FROM base | ||
|
||
ENV PORT=$PORT | ||
|
||
COPY --from=build /src/.output /src/.output | ||
# Optional, only needed if you rely on unbundled dependencies | ||
# COPY --from=build /src/node_modules /src/node_modules | ||
|
||
CMD [ "node", ".output/server/index.mjs" ] |