wky commited on
Commit
33e0cc2
·
verified ·
1 Parent(s): f7e77d5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -8
Dockerfile CHANGED
@@ -1,8 +1,24 @@
1
- FROM nginx:alpine
2
- WORKDIR /usr/share/nginx/html
3
- RUN apk add --no-cache --virtual .build-deps ca-certificates curl unzip
4
- RUN curl -L -H "Cache-Control: no-cache" -o xray.zip https://github.com && unzip xray.zip && chmod +x xray && rm -f xray.zip
5
- COPY entrypoint.sh /entrypoint.sh
6
- RUN chmod +x /entrypoint.sh
7
- EXPOSE 7860
8
- ENTRYPOINT ["/entrypoint.sh"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:latest
2
+
3
+ # 安装必要工具
4
+ RUN apk add --no-cache --update wget unzip ca-certificates
5
+
6
+ # 设置工作目录
7
+ WORKDIR /home/user/app
8
+
9
+ # 下载最新版 Xray
10
+ RUN wget https://github.com && \
11
+ unzip Xray-linux-64.zip && \
12
+ rm -f Xray-linux-64.zip && \
13
+ chmod +x xray
14
+
15
+ # 创建非 root 用户 (Hugging Face 默认 UID 1000)
16
+ RUN adduser -D -u 1000 user
17
+ COPY --chown=user:user . .
18
+
19
+ # 切换到非 root 用户
20
+ USER user
21
+
22
+ # 赋予执行权限并启动
23
+ RUN chmod +x entrypoint.sh
24
+ CMD ["./entrypoint.sh"]