Created
December 30, 2022 03:38
-
-
Save Bogyie/23efa18b0716ed467694f0cf9bf20eb4 to your computer and use it in GitHub Desktop.
vue build and depoloy with nginx
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
# build | |
FROM node:17-alpine as builder | |
WORKDIR /app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
# publish | |
FROM nginx:stable-alpine | |
RUN rm -rf /etc/nginx/conf.d/default.conf | |
COPY --from=builder /app/nginx/default.conf /etc/nginx/conf.d/default.conf | |
RUN rm -rf /usr/share/nginx/html/* | |
COPY --from=builder /app/dist /usr/share/nginx/html | |
EXPOSE 80 | |
ENTRYPOINT [ "nginx", "-g", "daemon off;" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment