Skip to content

Instantly share code, notes, and snippets.

@Bogyie
Created December 30, 2022 03:38
Show Gist options
  • Save Bogyie/23efa18b0716ed467694f0cf9bf20eb4 to your computer and use it in GitHub Desktop.
Save Bogyie/23efa18b0716ed467694f0cf9bf20eb4 to your computer and use it in GitHub Desktop.
vue build and depoloy with nginx
# 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