mirror of
https://github.com/Codennnn/vue-color-avatar.git
synced 2024-12-22 03:32:38 +00:00
Merge pull request #16 from wenyang0/main
Add the docker deploy method for this project.
This commit is contained in:
commit
6a9e133e75
20
Dockerfile
Normal file
20
Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
# Use node:alpine3.17 image as the base image
|
||||
FROM docker.io/node:alpine3.17
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
22
README-CN.md
22
README-CN.md
@ -49,3 +49,25 @@ yarn install
|
||||
# 3. 运行项目
|
||||
yarn dev
|
||||
```
|
||||
|
||||
## Docker 快速部署
|
||||
|
||||
你可以直接使用我已经构建好的镜像来运行
|
||||
```sh
|
||||
docker run -d -t -p 5173:5173 --name vue-color-avatar --restart=always docker.io/wenyang0/vue-color-avatar:latest
|
||||
```
|
||||
|
||||
或者,如果您愿意,也可以自己手动编译。
|
||||
|
||||
```sh
|
||||
#下载代码
|
||||
git clone https://github.com/Codennnn/vue-color-avatar.git
|
||||
|
||||
#docker 编译
|
||||
cd vue-color-avatar/
|
||||
docker build -t vue-color-avatar:v1 .
|
||||
|
||||
#启动服务
|
||||
docker run -d -t -p 5173:5173 --name vue-color-avatar --restart=always vue-color-avatar:v1
|
||||
```
|
||||
最后,打开你的浏览器访问服务的地址 http://serverIP:5173 即可
|
||||
|
22
README.md
22
README.md
@ -46,3 +46,25 @@ yarn install
|
||||
# 3. Run
|
||||
yarn dev
|
||||
```
|
||||
|
||||
## Docker deploy
|
||||
|
||||
You can directly run using the image I have already built.
|
||||
```sh
|
||||
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.
|
||||
|
||||
```sh
|
||||
#clone the code
|
||||
git clone https://github.com/Codennnn/vue-color-avatar.git
|
||||
|
||||
#docker build
|
||||
cd vue-color-avatar/
|
||||
docker build -t vue-color-avatar:v1 .
|
||||
|
||||
#start server
|
||||
docker run -d -t -p 5173:5173 --name vue-color-avatar --restart=always vue-color-avatar:v1
|
||||
```
|
||||
Finally, open your browser and access the service's address at http://serverIP:5173
|
||||
|
Loading…
Reference in New Issue
Block a user