From 3496861362c5393d399d4b5bd795d7609a3f918e Mon Sep 17 00:00:00 2001 From: Kakune55 Date: Sun, 24 Dec 2023 12:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86DockerFile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Dockerfile | 5 +++++ README.md | 22 ++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 Dockerfile 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