ykl45 commited on
Commit
7e67a35
·
verified ·
1 Parent(s): 974e9fe

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -0
Dockerfile ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 使用基础镜像
2
+ FROM golang:alpine AS builder
3
+
4
+ # 安装必要的工具
5
+ RUN apk update && apk add --no-cache \
6
+ curl \
7
+ uzip
8
+
9
+ # 创建新的工作目录
10
+ WORKDIR /app
11
+
12
+
13
+ # 下载并解压文件,并给予所有用户读写和执行权限
14
+ RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/wozulong/Palaude/releases/latest)) \
15
+ && base_url="https://github.com/wozulong/Palaude/releases/expanded_assets/$version" \
16
+ && latest_url="https://github.com/$(curl -sL $base_url | grep "href.*linux-amd64.*\.zip" | sed 's/.*href="//' | sed 's/".*//')" \
17
+ && curl -Lo palaude.zip $latest_url \
18
+ && unzip palaude.zip -d ./temp \
19
+ && mv temp/palaude . \
20
+ && rm -rf temp palaude.zip \
21
+ && chmod 777 -R .
22
+
23
+
24
+ # 获取config.json
25
+ RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \
26
+ cat /etc/secrets/CONFIG_JSON > config.json && chmod 777 config.json
27
+
28
+ # 修改PandoraNext的执行权限
29
+ RUN chmod 777 ./palaude
30
+
31
+ # 创建全局缓存目录并提供最宽松的权限
32
+ RUN mkdir /.cache && chmod 777 /.cache
33
+
34
+ # 开放端口
35
+ EXPOSE 8181
36
+
37
+ # 启动命令
38
+ CMD ["./palaude"]