feat: 🎸 增加一键启动脚本

This commit is contained in:
xubiaolin 2022-02-19 13:06:07 +08:00
parent 2db2583445
commit 64a6a1ae3e
4 changed files with 18 additions and 3 deletions

View File

@ -1,6 +1,6 @@
FROM alpine:latest
ADD ./run.sh /app/
ADD ./server.sh /app/
ADD ./patch /opt/patch/
VOLUME ["/var/lib/zerotier-one/"]
@ -39,4 +39,4 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/re
sh build.sh
WORKDIR /app/
CMD ["sh","./run.sh"]
CMD ["sh","./server.sh"]

15
deploy.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
imageName="zerotier-planet"
echo "清除原有内容"
rm -rf /opt/$imageName
docker stop $imageName
docker rm $imageName
docker rmi $imageName
echo "打包镜像"
docker build -t $imageName:latest .
echo "启动服务"
for i in $(lsof -i:9993 -t);do kill -2 $i;done
docker run -d --name $imageName -p 3443:3443 -p 9993:9993 -p 9993:9993/udp -v /opt/$imageName:/var/lib/zerotier-one --restart unless-stopped $imageName:latest

View File

@ -1,5 +1,5 @@
{
"stableEndpoints": [
"81.70.255.9/9993"
"82.157.68.236/9993"
]
}

View File