diff --git a/Dockerfile b/Dockerfile index d0a58a3..3793a7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,36 +7,12 @@ FROM v2fly/v2fly-core:latest # CMD /configure.sh +ADD v2rayconf.sh . + ARG UUID ENV UUID=$UUID RUN touch /etc/v2ray/config.json -RUN cat > /etc/v2ray/config.json <<'EOF' \ -{ \ - "inbounds": [\ - {\ - "port": $PORT,\ - "protocol": "vmess",\ - "settings": {\ - "clients": [\ - {\ - "id": "$UUID",\ - "alterId": 64\ - }\ - ],\ - "disableInsecureEncryption": true\ - },\ - "streamSettings": {\ - "network": "ws"\ - }\ - }\ - ],\ - "outbounds": [\ - {\ - "protocol": "freedom"\ - }\ - ]\ -}\ -EOF +RUN v2rayconf.sh CMD [ "/usr/bin/v2ray", "-config", "/etc/v2ray/config.json" ] diff --git a/test.js b/test.js deleted file mode 100644 index e69de29..0000000 diff --git a/v2rayconf.sh b/v2rayconf.sh new file mode 100644 index 0000000..913d379 --- /dev/null +++ b/v2rayconf.sh @@ -0,0 +1,27 @@ +cat << EOF > /etc/v2ray/config.json +{ + "inbounds": [ + { + "port": $PORT, + "protocol": "vmess", + "settings": { + "clients": [ + { + "id": "$UUID", + "alterId": 64 + } + ], + "disableInsecureEncryption": true + }, + "streamSettings": { + "network": "ws" + } + } + ], + "outbounds": [ + { + "protocol": "freedom" + } + ] +} +EOF