Skip to content

Commit

Permalink
Merge pull request hiifeng#13 from fakeDs/patch-1
Browse files Browse the repository at this point in the history
Thank you for your sharing.
  • Loading branch information
hiifeng authored Feb 6, 2023
2 parents 00b3341 + eddde9a commit ae4e917
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
22 changes: 15 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM nginx:latest
# FROM nginx:latest
FROM nginx:mainline-alpine-slim
MAINTAINER ifeng <https://t.me/HiaiFeng>
EXPOSE 80
USER root

RUN apt-get update && apt-get install -y supervisor wget unzip
# RUN apt-get update && apt-get install -y supervisor wget unzip
RUN apk update && apk add --no-cache supervisor wget unzip

# 定义 UUID 及 伪装路径,请自行修改.(注意:伪装路径以 / 符号开始,为避免不必要的麻烦,请不要使用特殊符号.)
ENV UUID de04add9-5c68-8bab-950c-08cd5320df18
Expand All @@ -19,10 +21,16 @@ COPY entrypoint.sh /usr/local/v2ray/

# 感谢 fscarmen 大佬提供 Dockerfile 层优化方案
RUN wget -q -O /tmp/v2ray-linux-64.zip https://github.com/v2fly/v2ray-core/releases/download/v4.45.0/v2ray-linux-64.zip && \
unzip -d /usr/local/v2ray /tmp/v2ray-linux-64.zip v2ray v2ctl && \
unzip -d /usr/local/v2ray /tmp/v2ray-linux-64.zip v2ray && \
wget -q -O /usr/local/v2ray/geosite.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat && \
wget -q -O /usr/local/v2ray/geoip.dat https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat && \
chmod a+x /usr/local/v2ray/entrypoint.sh

ENTRYPOINT [ "/usr/local/v2ray/entrypoint.sh" ]
CMD ["/usr/bin/supervisord"]
chmod a+x /usr/local/v2ray/entrypoint.sh && \
sh /usr/local/v2ray/entrypoint.sh && \
apk del wget unzip && \
rm -rf /tmp/v2ray-linux-64.zip && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*

# ENTRYPOINT [ "/usr/local/v2ray/entrypoint.sh" ]
# CMD ["/usr/bin/supervisord"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

sed -i "s#UUID#$UUID#g;s#VMESS_WSPATH#$VMESS_WSPATH#g;s#VLESS_WSPATH#$VLESS_WSPATH#g" /etc/v2ray/config.json
sed -i "s#VMESS_WSPATH#$VMESS_WSPATH#g;s#VLESS_WSPATH#$VLESS_WSPATH#g" /etc/nginx/nginx.conf
exec "$@"
# exec "$@"
3 changes: 3 additions & 0 deletions example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vless://de04add9-5c68-8bab-950c-08cd5320df18@localhost:443?encryption=none&security=tls&type=ws&path=%2Fvless#paas_vless

vmess://ew0KICAidiI6ICIyIiwNCiAgInBzIjogInBhYXNfdm1lc3MiLA0KICAiYWRkIjogImxvY2FsaG9zdCIsDQogICJwb3J0IjogIjQ0MyIsDQogICJpZCI6ICJkZTA0YWRkOS01YzY4LThiYWItOTUwYy0wOGNkNTMyMGRmMTgiLA0KICAiYWlkIjogIjAiLA0KICAic2N5IjogImF1dG8iLA0KICAibmV0IjogIndzIiwNCiAgInR5cGUiOiAibm9uZSIsDQogICJob3N0IjogIiIsDQogICJwYXRoIjogIi92bWVzcyIsDQogICJ0bHMiOiAidGxzIiwNCiAgInNuaSI6ICIiLA0KICAiYWxwbiI6ICIiDQp9

0 comments on commit ae4e917

Please sign in to comment.