添加了DockerFile

This commit is contained in:
2023-12-24 12:57:50 +08:00
parent d701f59a4e
commit 3496861362
3 changed files with 28 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/data /data
user.json user.json
自动交叉编译.cmd

5
Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM debian
ADD ./ /app
WORKDIR /app
EXPOSE 9090
ENTRYPOINT ["/app/main"]

View File

@@ -25,3 +25,25 @@ id 图片id
## 使用的外部库 ## 使用的外部库
"github.com/disintegration/imaging" MIT LICENSE "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
~~~