Spaces:
Paused
Paused
| 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 | |