Created
April 20, 2025 09:49
-
-
Save ValeryVerkhoturov/8acdbad35fc04450aeefafffdcf4f712 to your computer and use it in GitHub Desktop.
Dockerfile for SPA (Ex.: Vite)
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:20-alpine AS builder | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm i --force | |
COPY . . | |
RUN npm run build | |
FROM node:20-alpine AS runner | |
WORKDIR /app | |
RUN npm install -g serve | |
COPY --from=builder /app/dist ./dist | |
EXPOSE 4173 | |
CMD ["serve", "-s", "dist", "-l", "4173", "--no-clipboard"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment