BBrother commited on
Commit
4747aaa
1 Parent(s): fc643b6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -5
Dockerfile CHANGED
@@ -1,16 +1,16 @@
1
  # 使用基础镜像
2
- FROM golang:alpine AS builder
3
 
4
  # 安装必要的工具
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" \
@@ -39,8 +39,15 @@ RUN chmod 777 ./PandoraNext
39
  # 创建全局缓存目录并提供最宽松的权限
40
  RUN mkdir /.cache && chmod 777 /.cache
41
 
 
 
 
 
 
 
 
42
  # 开放端口
43
- EXPOSE 7860
44
 
45
- # 启动命令
46
- CMD ["./PandoraNext"]
 
1
  # 使用基础镜像
2
+ FROM golang:alpine
3
 
4
  # 安装必要的工具
5
  RUN apk update && apk add --no-cache \
6
  curl \
7
  tar \
8
  jq
9
+ openjdk11 # 添加 OpenJDK 11
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" \
 
39
  # 创建全局缓存目录并提供最宽松的权限
40
  RUN mkdir /.cache && chmod 777 /.cache
41
 
42
+ # 创建启动脚本
43
+ RUN echo '#!/bin/sh' > start.sh \
44
+ && echo 'JAR_URL=$(curl -s https://api.github.com/repos/Yanyutin753/PandoraNext-TokensTool/releases/latest | grep browser_download_url | grep "pandoraNext.*jar" | cut -d "\"" -f 4)' >> start.sh \
45
+ && echo 'wget -O pandoraNext.jar "${JAR_URL}"' >> start.sh \
46
+ && echo 'java -jar pandoraNext.jar --server.port=8081 --deployWay=releases --deployPosition=default --pandora_Ip=127.0.0.1' >> start.sh \
47
+ && chmod +x start.sh
48
+
49
  # 开放端口
50
+ EXPOSE 8081
51
 
52
+ # 启动命令,这里使用 shell 执行 start.sh 脚本
53
+ CMD ["sh", "start.sh"]