Vue app production dockerfile
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
# use node alpine | |
FROM node:13.11.0-alpine as builder | |
# set the working directory in the container | |
WORKDIR /app | |
# COPY the package json and package json lock files | |
COPY package*.json ./ | |
# perform npm install | |
RUN npm install | |
# copy all files to the work directory | |
COPY . . | |
# run the command | |
RUN npm run build-prod | |
FROM nginx | |
# expose the port | |
EXPOSE 8080 | |
# copy nginx config | |
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf | |
COPY --from=builder /app/dist /usr/share/nginx/html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment