Merge pull request #18 from wenyang0/main

Optimize Docker Image Size
This commit is contained in:
LeoKu 2023-08-18 12:45:04 +08:00 committed by GitHub
commit df7c3c19ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -14,7 +14,7 @@ EXPOSE 5173
WORKDIR /app 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 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 # 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
CMD yarn dev --host 0.0.0.0 CMD yarn dev --host 0.0.0.0

View File

@ -54,7 +54,11 @@ yarn dev
你可以直接使用我已经构建好的镜像来运行 你可以直接使用我已经构建好的镜像来运行
```sh ```sh
docker run -d -t -p 5173:5173 --name vue-color-avatar --restart=always docker.io/wenyang0/vue-color-avatar:latest docker run -d -t -p 5173:5173 \
--name=vue-color-avatar \
--restart=always \
docker.io/wenyang0/vue-color-avatar:latest
``` ```
或者,如果您愿意,也可以自己手动编译。 或者,如果您愿意,也可以自己手动编译。

View File

@ -51,7 +51,11 @@ yarn dev
You can directly run using the image I have already built. You can directly run using the image I have already built.
```sh ```sh
docker run -d -t -p 5173:5173 --name vue-color-avatar --restart=always docker.io/wenyang0/vue-color-avatar:latest docker run -d -t -p 5173:5173 \
--name=vue-color-avatar \
--restart=always \
docker.io/wenyang0/vue-color-avatar:latest
``` ```
Or, you can manually compile it yourself if you prefer. Or, you can manually compile it yourself if you prefer.