-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
7159823
commit 07effeb
Showing
1 changed file
with
28 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Stolen from https://markus.oberlehner.net/blog/running-nuxt-3-in-a-docker-container/ | ||
FROM node:20-slim as base | ||
|
||
ARG PORT=3000 | ||
|
||
ENV NODE_ENV=production | ||
|
||
WORKDIR /src | ||
|
||
# Do a multi-stage image build: this first stage builds the app | ||
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 | ||
|
||
# Final 'run' stage of image build copies the built app from the 'build' stage | ||
FROM base | ||
|
||
ENV PORT=$PORT | ||
|
||
COPY --from=build /src/.output /src/.output | ||
|
||
CMD [ "node", ".output/server/index.mjs" ] |