clash-linux commited on
Commit
4787487
·
verified ·
1 Parent(s): 54f3244

Upload 11 files

Browse files
Files changed (2) hide show
  1. Dockerfile +8 -10
  2. app/main.py +1 -1
Dockerfile CHANGED
@@ -26,31 +26,29 @@ ENV TZ=Asia/Shanghai
26
  RUN mkdir -p ./clash_core ./subconverter ./data && \
27
  chmod -R 777 ./data
28
 
29
- # 下载并安装Clash Meta
30
  RUN echo "Downloading Clash Meta..." && \
31
  curl -L -f -o /tmp/clash-meta.gz "https://github.com/MetaCubeX/Clash.Meta/releases/download/v1.16.0/clash.meta-linux-amd64-v1.16.0.gz" && \
32
  echo "Extracting Clash Meta..." && \
33
- gunzip -c /tmp/clash-meta.gz > ./clash_core/clash-linux-amd64 && \
34
  echo "Setting Clash Meta permissions..." && \
35
- chmod +x ./clash_core/clash-linux-amd64 && \
36
  echo "Verifying Clash Meta exists..." && \
37
- test -f ./clash_core/clash-linux-amd64 && \
38
  echo "Cleaning up Clash Meta download..." && \
39
  rm /tmp/clash-meta.gz
40
 
41
- # 下载并安装subconverter
42
  RUN echo "Downloading subconverter..." && \
43
  curl -L -f -o /tmp/subconverter.tar.gz "https://github.com/tindy2013/subconverter/releases/download/v0.7.2/subconverter_linux64.tar.gz" && \
44
- echo "Extracting subconverter..." && \
45
- tar -xzf /tmp/subconverter.tar.gz -C /tmp && \
46
- echo "Copying subconverter files..." && \
47
- cp -R /tmp/subconverter/* ./subconverter/ && \
48
  echo "Setting subconverter permissions..." && \
49
  chmod +x ./subconverter/subconverter && \
50
  echo "Verifying subconverter exists..." && \
51
  test -f ./subconverter/subconverter && \
52
  echo "Cleaning up subconverter download..." && \
53
- rm -rf /tmp/subconverter*
54
 
55
  # 复制Python依赖列表
56
  COPY requirements.txt ./
 
26
  RUN mkdir -p ./clash_core ./subconverter ./data && \
27
  chmod -R 777 ./data
28
 
29
+ # 下载并安装Clash Meta,并重命名
30
  RUN echo "Downloading Clash Meta..." && \
31
  curl -L -f -o /tmp/clash-meta.gz "https://github.com/MetaCubeX/Clash.Meta/releases/download/v1.16.0/clash.meta-linux-amd64-v1.16.0.gz" && \
32
  echo "Extracting Clash Meta..." && \
33
+ gunzip -c /tmp/clash-meta.gz > ./clash_core/clash-meta-linux-amd64 && \
34
  echo "Setting Clash Meta permissions..." && \
35
+ chmod +x ./clash_core/clash-meta-linux-amd64 && \
36
  echo "Verifying Clash Meta exists..." && \
37
+ test -f ./clash_core/clash-meta-linux-amd64 && \
38
  echo "Cleaning up Clash Meta download..." && \
39
  rm /tmp/clash-meta.gz
40
 
41
+ # 下载并完整解压subconverter
42
  RUN echo "Downloading subconverter..." && \
43
  curl -L -f -o /tmp/subconverter.tar.gz "https://github.com/tindy2013/subconverter/releases/download/v0.7.2/subconverter_linux64.tar.gz" && \
44
+ echo "Extracting subconverter archive..." && \
45
+ tar -xzf /tmp/subconverter.tar.gz -C ./subconverter --strip-components=1 && \
 
 
46
  echo "Setting subconverter permissions..." && \
47
  chmod +x ./subconverter/subconverter && \
48
  echo "Verifying subconverter exists..." && \
49
  test -f ./subconverter/subconverter && \
50
  echo "Cleaning up subconverter download..." && \
51
+ rm /tmp/subconverter.tar.gz
52
 
53
  # 复制Python依赖列表
54
  COPY requirements.txt ./
app/main.py CHANGED
@@ -58,7 +58,7 @@ def initialize():
58
  # 初始化Clash管理器
59
  clash_manager = ClashManager(
60
  config_path=os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", "config.yaml"),
61
- clash_path=os.path.join(os.path.dirname(os.path.dirname(__file__)), "clash_core", "clash-linux-amd64"),
62
  api_port=CLASH_API_PORT,
63
  proxy_port=CLASH_PROXY_PORT
64
  )
 
58
  # 初始化Clash管理器
59
  clash_manager = ClashManager(
60
  config_path=os.path.join(os.path.dirname(os.path.dirname(__file__)), "data", "config.yaml"),
61
+ clash_path=os.path.join(os.path.dirname(os.path.dirname(__file__)), "clash_core", "clash-meta-linux-amd64"),
62
  api_port=CLASH_API_PORT,
63
  proxy_port=CLASH_PROXY_PORT
64
  )