Skip to content

Commit

Permalink
dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Aug 8, 2024
1 parent 7159823 commit 07effeb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docker/Dockerfile
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" ]

0 comments on commit 07effeb

Please sign in to comment.