Last active
July 8, 2023 14:40
-
-
Save begoon/4afa081eaddf0672dd98ea0321e28338 to your computer and use it in GitHub Desktop.
Dockerize SvelteKit app for nodejs
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:20.2.0-bullseye-slim AS build | |
WORKDIR /app | |
COPY . . | |
RUN npm install | |
RUN npm run build | |
# --- | |
FROM node:20.2.0-bullseye-slim AS package | |
WORKDIR /app | |
COPY package.json . | |
COPY package-lock.json . | |
RUN npm ci --production | |
# --- | |
FROM node:20.2.0-bullseye-slim | |
WORKDIR /app | |
COPY --from=build /app/build build/ | |
COPY --from=package /app/node_modules node_modules/ | |
COPY package.json . | |
CMD [ "node", "build" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment