vue-color-avatar/Dockerfile

27 lines
753 B
Docker
Raw Normal View History

2023-11-09 19:09:12 +00:00
# Use node as the builder image
2023-11-09 18:22:09 +00:00
FROM docker.io/node:alpine3.17 as builder
2023-04-12 06:20:28 +00:00
# Copy the vue-color-avatar file from the local directory to the /app directory inside the container
2023-04-12 06:52:29 +00:00
COPY . /app
2023-04-12 06:20:28 +00:00
# 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
2023-04-12 06:20:28 +00:00
2023-11-09 18:22:09 +00:00
# Building the html code
RUN yarn build
# Using nginx for production
FROM docker.io/nginxinc/nginx-unprivileged:1.25.1-alpine
2023-11-09 19:07:04 +00:00
# Showing that port 8080 can be published
EXPOSE 8080
# Maintainer information
MAINTAINER tanwenyang@aliyun.com
2023-11-09 18:22:09 +00:00
# Copy html from previous stage
COPY --from=builder /app/dist /usr/share/nginx/html