Last active
January 11, 2023 20:04
-
-
Save khromov/390e03a5765659a8313127568c10c463 to your computer and use it in GitHub Desktop.
SvelteKit staged build Dockerfile
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
node_modules | |
README.md | |
.svelte-kit | |
npm-debug.log* | |
yarn-debug.log* | |
yarn-error.log* | |
.pnpm-debug.log* | |
.env*.local | |
.env.local | |
.env |
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:18-alpine AS sk-build | |
ARG TZ=Europe/Stockholm | |
WORKDIR /usr/src/app | |
COPY . /usr/src/app | |
RUN apk --no-cache add curl tzdata | |
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
RUN npm install | |
RUN npm run build | |
FROM node:18-alpine | |
WORKDIR /usr/src/app | |
COPY --from=sk-build /usr/src/app/build /usr/src/app/build | |
COPY --from=sk-build /usr/src/app/package.json /usr/src/app/package.json | |
EXPOSE 3000 | |
# Your start command in package.json should look something like: node build/index.js | |
CMD ["npm", "run", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment