Skip to content

Instantly share code, notes, and snippets.

@dievardump
Created April 27, 2021 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dievardump/e5e9df086e3b497a32cfad93d5060a08 to your computer and use it in GitHub Desktop.
Save dievardump/e5e9df086e3b497a32cfad93d5060a08 to your computer and use it in GitHub Desktop.
Dockerfile build for sveltekit
FROM node:14 as builder
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:14 as installer
WORKDIR /home/node/app
COPY package*.json ./
RUN npm install --only=production
# Build final runtime container
FROM node:14
COPY --from=builder /home/node/app/build /home/node/app/build
COPY --from=installer /home/node/app/node_modules /home/node/app/node_modules
COPY package*.json /home/node/app/
WORKDIR /home/node/app
EXPOSE 3000
CMD [ "node", "./build/index.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment