-
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
1 parent
e90dd9a
commit 34f4127
Showing
1 changed file
with
15 additions
and
4 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 |
---|---|---|
@@ -1,15 +1,26 @@ | ||
# Dockerfile | ||
FROM node:20-alpine3.17 | ||
FROM node:20-alpine as builder | ||
|
||
WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
COPY package.json /app/ | ||
COPY package-lock.json /app/ | ||
|
||
RUN npm install | ||
ADD . /app | ||
RUN npm run build | ||
|
||
# start final image | ||
FROM node:20-alpine | ||
|
||
COPY . . | ||
WORKDIR /app | ||
|
||
# copy over build files from builder step | ||
COPY --from=builder /app/.output app/.output | ||
COPY --from=builder /app/.nuxt app/.nuxt | ||
|
||
# expose the host and port 3000 to the server | ||
ENV HOST 0.0.0.0 | ||
EXPOSE 3000 | ||
|
||
RUN npm run build | ||
CMD [ "npm", "run", "start" ] |