File size: 1,001 Bytes
38e5725
e676cc9
 
c24dfe4
e676cc9
 
 
 
 
 
 
 
 
38e5725
e676cc9
38e5725
 
 
 
 
 
 
 
e676cc9
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 FROM alpine:latest

# Set the Hugging Face port
ENV PORT=7860

# Install V2Ray core
RUN apk add --no-cache curl && \
    curl -L -H "Cache-Control: no-cache" -o /tmp/v2ray.zip https://github.com/v2fly/v2ray-core/releases/latest/download/v2ray-linux-64.zip && \
    mkdir -p /usr/bin/v2ray /etc/v2ray && \
    unzip /tmp/v2ray.zip -d /usr/bin/v2ray && \
    chmod +x /usr/bin/v2ray/v2ray && \
    rm /tmp/v2ray.zip

# Create the config file with the new /ws path
RUN echo '{\
    "log": {"loglevel": "warning"},\
    "inbounds": [{\
        "port": 7860,\
        "protocol": "vmess",\
        "settings": {"clients": [{"id": "MY_UUID_HERE"}]},\
        "streamSettings": {"network": "ws", "wsSettings": {"path": "/ws"}}\
    }],\
    "outbounds": [{"protocol": "freedom", "settings": {}}]\
}' > /etc/v2ray/config.json

# Start V2Ray and replace the placeholder with your actual Variable
CMD sed -i "s/MY_UUID_HERE/$UUID/g" /etc/v2ray/config.json && /usr/bin/v2ray/v2ray run -c /etc/v2ray/config.json