FROM node:lts AS dev
# some dir for our code
WORKDIR /app
RUN yarn global add @vue/cli @vue/cli-service-global
# mount code
VOLUME ["/app"]
# this is how we start
CMD [ "vue", "ui", "--host", "0.0.0.0", "--port", "8080" ]
FROM node:lts AS build
# install dependencies
COPY package*.json yarn*.lock ./
RUN yarn --production=false
# copy code
COPY . .
RUN yarn build
FROM nginx:stable-alpine AS prod
COPY --from=build /app/dist /usr/share/nginx/html