# Use node:alpine3.17 image as the base image FROM docker.io/node:alpine3.17 as builder # Maintainer information MAINTAINER tanwenyang@aliyun.com # Copy the vue-color-avatar file from the local directory to the /app directory inside the container COPY . /app # Expose port 5173 of the container and allow external access to this port EXPOSE 5173 # Change the working directory to /app WORKDIR /app # Set the Yarn registry to Taobao mirror and install dependencies using yarn install RUN yarn config set registry 'https://registry.npm.taobao.org' && yarn install && yarn cache clean # Building the html code RUN yarn build # Using nginx for production FROM docker.io/nginxinc/nginx-unprivileged:1.25.1-alpine # Copy html from previous stage COPY --from=builder /app/dist /usr/share/nginx/html