mkdir vue-docker && cd "$_" && docker run --rm -v "${PWD}:/$(basename `pwd`)" -w "/$(basename `pwd`)" -it node:17-alpine3.14 sh -c "yarn global add @vue/cli && vue create ."
Dockerfile
content:
# develop stage
FROM node:16.14.0 as develop-stage
WORKDIR /app
COPY package*.json ./
RUN yarn install
COPY . .
# build stage
FROM develop-stage as build-stage
RUN yarn build
# production stage
FROM nginx:1.15.7-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
docker build -t vue-docker .
docker run -it -p 80:80 --rm vue-docker
--
yarn install
yarn serve
yarn build
yarn lint