Created
April 27, 2021 22:38
-
-
Save dievardump/e5e9df086e3b497a32cfad93d5060a08 to your computer and use it in GitHub Desktop.
Dockerfile build for sveltekit
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
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