rufatronics commited on
Commit
e676cc9
·
verified ·
1 Parent(s): 46a1c33

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -4
Dockerfile CHANGED
@@ -1,6 +1,30 @@
1
- FROM v2fly/v2fly-core:latest
 
 
 
2
  ENV PORT=7860
3
- RUN mkdir -p /etc/v2ray
4
- RUN echo '{"log":{"loglevel":"warning"},"inbounds":[{"port":7860,"protocol":"vmess","settings":{"clients":[{"id":"UUID_KEY"}]},"streamSettings":{"network":"ws","wsSettings":{"path":"/"}}}],"outbounds":[{"protocol":"freedom","settings":{}}]}' > /etc/v2ray/config.json
5
- CMD sed -i "s/UUID_KEY/$UUID/g" /etc/v2ray/config.json && /usr/bin/v2ray run -c /etc/v2ray/config.json
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
 
1
+ # Use Alpine Linux as it's lightweight and includes a shell
2
+ FROM alpine:latest
3
+
4
+ # Set the Hugging Face port
5
  ENV PORT=7860
6
+
7
+ # Install V2Ray core
8
+ RUN apk add --no-cache curl && \
9
+ curl -L -H "Cache-Control: no-cache" -o /tmp/v2ray.zip https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip && \
10
+ mkdir -p /usr/bin/v2ray /etc/v2ray && \
11
+ unzip /tmp/v2ray.zip -d /usr/bin/v2ray && \
12
+ chmod +x /usr/bin/v2ray/v2ray && \
13
+ rm /tmp/v2ray.zip
14
+
15
+ # Create the config file with a placeholder for your UUID
16
+ RUN echo '{\
17
+ "log": {"loglevel": "warning"},\
18
+ "inbounds": [{\
19
+ "port": 7860,\
20
+ "protocol": "vmess",\
21
+ "settings": {"clients": [{"id": "MY_UUID_HERE"}]},\
22
+ "streamSettings": {"network": "ws", "wsSettings": {"path": "/"}}\
23
+ }],\
24
+ "outbounds": [{"protocol": "freedom", "settings": {}}]\
25
+ }' > /etc/v2ray/config.json
26
+
27
+ # Start V2Ray and replace the placeholder with your actual Variable
28
+ CMD sed -i "s/MY_UUID_HERE/$UUID/g" /etc/v2ray/config.json && /usr/bin/v2ray/v2ray run -c /etc/v2ray/config.json
29
+
30