araco commited on
Commit
dc4bfcb
·
verified ·
1 Parent(s): 603e9f8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:latest
2
+
3
+ # 设置工作目录
4
+ WORKDIR /app
5
+
6
+ # 安装必要的工具
7
+ RUN apk add --no-cache curl unzip
8
+
9
+ # 下载 Xray (以 1.8.4 为例,可自选版本)
10
+ RUN curl -L -H "Cache-Control: no-cache" -o xray.zip https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip && \
11
+ unzip xray.zip && \
12
+ chmod +x xray
13
+
14
+ # 创建简易启动脚本
15
+ RUN echo '#!/bin/sh' > entrypoint.sh && \
16
+ echo 'cat <<EOF > config.json' >> entrypoint.sh && \
17
+ echo '{ "inbounds": [{ "port": 7860, "protocol": "vless", "settings": { "clients": [{ "id": "$UUID", "level": 0 }], "decryption": "none" }, "streamSettings": { "network": "ws", "wsSettings": { "path": "$WSPATH" } } }], "outbounds": [{ "protocol": "freedom" }] }' >> entrypoint.sh && \
18
+ echo 'EOF' >> entrypoint.sh && \
19
+ echo './xray -config config.json' >> entrypoint.sh && \
20
+ chmod +x entrypoint.sh
21
+
22
+ # Hugging Face 默认监听 7860 端口
23
+ EXPOSE 7860
24
+
25
+ CMD ["./entrypoint.sh"]