Created
April 11, 2024 06:22
-
-
Save algonacci/cd0576ebbf68040d9a0c4bc9e1b22866 to your computer and use it in GitHub Desktop.
A simple Dockerfile to deploy a Vite-based frontend app
This file contains hidden or 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:lts-alpine as build-stage | |
WORKDIR /app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
FROM node:lts-alpine as serve-stage | |
WORKDIR /app | |
RUN npm install -g serve | |
COPY --from=build-stage /app/dist /app/dist | |
EXPOSE 8080 | |
CMD ["serve", "-s", "dist", "-l", "8080"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment