Skip to content

Instantly share code, notes, and snippets.

@suprith-s-reddy
Last active April 28, 2020 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suprith-s-reddy/35e185ea4d9a70b80f55e94883d01daf to your computer and use it in GitHub Desktop.
Save suprith-s-reddy/35e185ea4d9a70b80f55e94883d01daf to your computer and use it in GitHub Desktop.
Vue app production dockerfile
# 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