working with nginx on port 8080

This commit is contained in:
gimse 2023-11-09 19:22:09 +01:00
parent 9197e862c5
commit 693dc16c84

View File

@ -1,5 +1,5 @@
# Use node:alpine3.17 image as the base image # Use node:alpine3.17 image as the base image
FROM docker.io/node:alpine3.17 FROM docker.io/node:alpine3.17 as builder
# Maintainer information # Maintainer information
MAINTAINER tanwenyang@aliyun.com MAINTAINER tanwenyang@aliyun.com
@ -16,5 +16,11 @@ WORKDIR /app
# Set the Yarn registry to Taobao mirror and install dependencies using yarn install # 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 RUN yarn config set registry 'https://registry.npm.taobao.org' && yarn install && yarn cache clean
# Run the command to start the container, which will run the project in development mode and listen on port 5173 of address 0.0.0.0 # Building the html code
CMD yarn dev --host 0.0.0.0 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