diff --git a/.gitignore b/.gitignore index ee1b030..68e1e85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /data user.json +自动交叉编译.cmd diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2a7dc54 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM debian +ADD ./ /app +WORKDIR /app +EXPOSE 9090 +ENTRYPOINT ["/app/main"] \ No newline at end of file diff --git a/README.md b/README.md index 01dae12..776cb08 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,25 @@ id 图片id ## 使用的外部库 "github.com/disintegration/imaging" MIT LICENSE + +# 部署 +## 直接部署 +- 确保本机拥有go环境 +- 确保网络良好 +~~~bash +git clone https://github.com/Kakune55/Pixel.git #克隆存储库 +cd ./Pixel #进入工作目录 +go build main.go #编译 +./main #运行 +~~~ +## 使用Docker (仅支持Linux-X86_64) +### 导入镜像 +~~~bash +wget https://github.com/Kakune55/Pixel/releases/download/v1.0/pixel.tar.gz #版本号仅供参考 +tar -zxvf pixel.tar.gz #解压 +docker load pixel.tar #导入镜像 +~~~ +### 运行容器 +~~~bash +docker run -d -p <你需要的端口号>:9090 --name:pixel pixel +~~~ \ No newline at end of file