From 64a6a1ae3e155a23cae93347ca098ab6a21b9a14 Mon Sep 17 00:00:00 2001 From: xubiaolin Date: Sat, 19 Feb 2022 13:06:07 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++-- deploy.sh | 15 +++++++++++++++ patch/patch.json | 2 +- run.sh => server.sh | 0 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 deploy.sh rename run.sh => server.sh (100%) diff --git a/Dockerfile b/Dockerfile index 7fc6f33..ef315cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..ae0c4d3 --- /dev/null +++ b/deploy.sh @@ -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 diff --git a/patch/patch.json b/patch/patch.json index dcb4c65..a5476b0 100644 --- a/patch/patch.json +++ b/patch/patch.json @@ -1,5 +1,5 @@ { "stableEndpoints": [ - "81.70.255.9/9993" + "82.157.68.236/9993" ] } diff --git a/run.sh b/server.sh similarity index 100% rename from run.sh rename to server.sh