Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +11 -19
Dockerfile
CHANGED
@@ -5,13 +5,13 @@ FROM golang:alpine AS builder
|
|
5 |
RUN apk update && apk add --no-cache \
|
6 |
curl \
|
7 |
tar \
|
8 |
-
jq
|
9 |
-
openjdk11
|
10 |
|
11 |
# 创建新的工作目录
|
12 |
WORKDIR /app
|
13 |
|
14 |
-
|
|
|
15 |
RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/pandora-next/deploy/releases/latest)) \
|
16 |
&& base_url="https://github.com/pandora-next/deploy/releases/expanded_assets/$version" \
|
17 |
&& latest_url="https://github.com/$(curl -sL $base_url | grep "href.*amd64.*\.tar.gz" | sed 's/.*href="//' | sed 's/".*//')" \
|
@@ -20,35 +20,27 @@ RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://githu
|
|
20 |
&& rm PandoraNext.tar.gz \
|
21 |
&& chmod 777 -R .
|
22 |
|
23 |
-
#
|
24 |
-
RUN curl -Lo pandoraNext-0.4.7.3-SNAPSHOT.jar https://github.com/Yanyutin753/PandoraNext-TokensTool/raw/main/simplyDeploy/pandoraNext-0.4.7.3-SNAPSHOT.jar \
|
25 |
-
&& chmod 777 pandoraNext-0.4.7.3-SNAPSHOT.jar
|
26 |
-
|
27 |
-
# 获取 tokens.json
|
28 |
RUN --mount=type=secret,id=TOKENS_JSON,dst=/etc/secrets/TOKENS_JSON \
|
29 |
if [ -f /etc/secrets/TOKENS_JSON ]; then \
|
30 |
-
|
31 |
-
|
32 |
else \
|
33 |
-
|
34 |
fi
|
35 |
|
36 |
-
# 获取
|
37 |
RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \
|
38 |
cat /etc/secrets/CONFIG_JSON > config.json && chmod 777 config.json
|
39 |
|
40 |
-
# 修改
|
41 |
RUN chmod 777 ./PandoraNext
|
42 |
|
43 |
# 创建全局缓存目录并提供最宽松的权限
|
44 |
RUN mkdir /.cache && chmod 777 /.cache
|
45 |
|
46 |
-
# 复制启动脚本
|
47 |
-
COPY entrypoint.sh /app/entrypoint.sh
|
48 |
-
RUN chmod +x /app/entrypoint.sh
|
49 |
-
|
50 |
# 开放端口
|
51 |
-
EXPOSE
|
52 |
|
53 |
# 启动命令
|
54 |
-
CMD ["
|
|
|
5 |
RUN apk update && apk add --no-cache \
|
6 |
curl \
|
7 |
tar \
|
8 |
+
jq
|
|
|
9 |
|
10 |
# 创建新的工作目录
|
11 |
WORKDIR /app
|
12 |
|
13 |
+
|
14 |
+
# 下载并解压文件,并给予所有用户读写和执行权限
|
15 |
RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/pandora-next/deploy/releases/latest)) \
|
16 |
&& base_url="https://github.com/pandora-next/deploy/releases/expanded_assets/$version" \
|
17 |
&& latest_url="https://github.com/$(curl -sL $base_url | grep "href.*amd64.*\.tar.gz" | sed 's/.*href="//' | sed 's/".*//')" \
|
|
|
20 |
&& rm PandoraNext.tar.gz \
|
21 |
&& chmod 777 -R .
|
22 |
|
23 |
+
# 获取tokens.json
|
|
|
|
|
|
|
|
|
24 |
RUN --mount=type=secret,id=TOKENS_JSON,dst=/etc/secrets/TOKENS_JSON \
|
25 |
if [ -f /etc/secrets/TOKENS_JSON ]; then \
|
26 |
+
cat /etc/secrets/TOKENS_JSON > tokens.json \
|
27 |
+
&& chmod 777 tokens.json; \
|
28 |
else \
|
29 |
+
echo "TOKENS_JSON not found, skipping"; \
|
30 |
fi
|
31 |
|
32 |
+
# 获取config.json
|
33 |
RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \
|
34 |
cat /etc/secrets/CONFIG_JSON > config.json && chmod 777 config.json
|
35 |
|
36 |
+
# 修改PandoraNext的执行权限
|
37 |
RUN chmod 777 ./PandoraNext
|
38 |
|
39 |
# 创建全局缓存目录并提供最宽松的权限
|
40 |
RUN mkdir /.cache && chmod 777 /.cache
|
41 |
|
|
|
|
|
|
|
|
|
42 |
# 开放端口
|
43 |
+
EXPOSE 7860
|
44 |
|
45 |
# 启动命令
|
46 |
+
CMD ["./PandoraNext"]
|