feat: 🎸 修改加速地址

This commit is contained in:
xubiaolin 2023-05-15 10:19:35 +08:00
parent b80ee65d75
commit ca4a4216d1
2 changed files with 31 additions and 29 deletions

View File

@ -3,31 +3,37 @@ FROM alpine:3.17 as builder
ARG ZT_PORT ARG ZT_PORT
ENV TZ=Asia/Shanghai ENV TZ=Asia/Shanghai
ENV PROXY=https://ghself.markxu.online/
WORKDIR /app WORKDIR /app
ADD . /app ADD . /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
apk update && mkdir -p /usr/include/nlohmann/ && cd /usr/include/nlohmann/ && wget $(PROXY)https://github.com/nlohmann/json/releases/download/v3.10.5/json.hpp && && apk update\
apk add --no-cache git python3 npm make g++ zerotier-one && && mkdir -p /usr/include/nlohmann/ && cd /usr/include/nlohmann/ && wget https://ghself.markxu.online/https://github.com/nlohmann/json/releases/download/v3.10.5/json.hpp \
npm install -g node-gyp && mkdir /app -p && cd /app && git clone $(PROXY)https://github.com/key-networks/ztncui.git && cd /app/ztncui/src && && apk add --no-cache git python3 npm make g++ zerotier-one \
cp /app/patch/binding.gyp . && npm install && && npm install -g node-gyp\
echo 'HTTP_PORT=3443' >.env && && mkdir /app -p && cd /app && git clone https://ghself.markxu.online/https://github.com/key-networks/ztncui.git\
echo 'NODE_ENV=production' >>.env && && cd /app/ztncui/src \
echo 'HTTP_ALL_INTERFACES=true' >>.env && && cp /app/patch/binding.gyp .\
echo "ZT_ADDR=localhost:${ZT_PORT}" >>.env && echo "${ZT_PORT}" >/app/zerotier-one.port && && npm install \
cp -v etc/default.passwd etc/passwd && echo 'HTTP_PORT=3443' >.env \
&& echo 'NODE_ENV=production' >>.env \
&& echo 'HTTP_ALL_INTERFACES=true' >>.env \
&& echo "ZT_ADDR=localhost:${ZT_PORT}" >>.env\
&& echo "${ZT_PORT}" >/app/zerotier-one.port \
&& cp -v etc/default.passwd etc/passwd
RUN cd /app && git clone -v $(PROXY)https://github.com/zerotier/ZeroTierOne.git --depth 1 && zerotier-one -d && sleep 5s && ps -ef | grep zerotier-one | grep -v grep | awk '{print $1}' | xargs kill -9 && RUN cd /app && git clone -v https://ghself.markxu.online/https://github.com/zerotier/ZeroTierOne.git --depth 1\
cd /var/lib/zerotier-one && zerotier-idtool initmoon identity.public >moon.json && cd /app/patch && python3 patch.py && && zerotier-one -d && sleep 5s && ps -ef |grep zerotier-one |grep -v grep |awk '{print $1}' |xargs kill -9 \
cd /var/lib/zerotier-one && zerotier-idtool genmoon moon.json && mkdir moons.d && cp ./*.moon ./moons.d && && cd /var/lib/zerotier-one && zerotier-idtool initmoon identity.public >moon.json\
cd /app/ZeroTierOne/attic/world/ && sh build.sh && && cd /app/patch && python3 patch.py \
sleep 5s && && cd /var/lib/zerotier-one && zerotier-idtool genmoon moon.json && mkdir moons.d && cp ./*.moon ./moons.d \
cd /app/ZeroTierOne/attic/world/ && ./mkworld && && cd /app/ZeroTierOne/attic/world/ && sh build.sh \
mkdir /app/bin -p && cp world.bin /app/bin/planet && && sleep 5s \
TOKEN=$(cat /var/lib/zerotier-one/authtoken.secret) && && cd /app/ZeroTierOne/attic/world/ && ./mkworld \
echo "ZT_TOKEN=$TOKEN" >>/app/ztncui/src/.env && mkdir /app/bin -p && cp world.bin /app/bin/planet \
&& TOKEN=$(cat /var/lib/zerotier-one/authtoken.secret) \
&& echo "ZT_TOKEN=$TOKEN">> /app/ztncui/src/.env
FROM alpine:3.17 FROM alpine:3.17
WORKDIR /app WORKDIR /app
@ -37,9 +43,10 @@ COPY --from=builder /app/bin /app/bin
COPY --from=builder /app/zerotier-one.port /app/zerotier-one.port COPY --from=builder /app/zerotier-one.port /app/zerotier-one.port
COPY --from=builder /var/lib/zerotier-one /var/lib/zerotier-one COPY --from=builder /var/lib/zerotier-one /var/lib/zerotier-one
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
apk update && apk add --no-cache npm zerotier-one && apk update\
&& apk add --no-cache npm zerotier-one
VOLUME [ "/app","/var/lib/zerotier-one" ] VOLUME [ "/app","/var/lib/zerotier-one" ]
CMD /bin/sh -c "cd /var/lib/zerotier-one && ./zerotier-one -p$(cat /app/zerotier-one.port) -d; cd /app/ztncui/src;npm start" CMD /bin/sh -c "cd /var/lib/zerotier-one && ./zerotier-one -p`cat /app/zerotier-one.port` -d; cd /app/ztncui/src;npm start"

View File

@ -1,6 +1 @@
{ {"stableEndpoints":["175.29.122.43/9994"]}
"stableEndpoints": [
"/9993"
]
}