From 26f66cfd14fd3dd1565e0a6eb3422ce3158e6154 Mon Sep 17 00:00:00 2001 From: Aoang Date: Thu, 14 Mar 2024 22:01:20 +0800 Subject: [PATCH] init test --- .github/workflows/build.yml | 12 ++++++++++ .gitignore | 1 + Dockerfile | 46 +++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4b1bb2e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,12 @@ +name: Build +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: docker build . diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..485dee6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc768b6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +FROM debian:bookworm-slim as builder + +ENV VERSION=v1.12.2 + +WORKDIR /app + +RUN apt-get update -y && apt-get install -y add --no-cache git python3 npm make linux-headers curl pkgconfig openssl-dev jq build-base clang + +RUN set -x\ + && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\ + && source "$HOME/.cargo/env"\ + && git clone --quiet --depth 1 -b $VERSION https://github.com/zerotier/ZeroTierOne.git\ + && cd ZeroTierOne && make ZT_SYMLINK=1 && make && make install + +#make ztncui +RUN set -x \ + && mkdir /app -p \ + && cd /app \ + && git clone --progress https://github.com/key-networks/ztncui.git\ + && cd /app/ztncui/src \ + && npm install -g node-gyp\ + && npm install + +FROM debian:bookworm-slim + +WORKDIR /app + + +ENV IP_ADDR4='' +ENV IP_ADDR6='' + +ENV ZT_PORT=9994 +ENV API_PORT=3443 +ENV FILE_SERVER_PORT=3000 + +ENV FILE_KEY='' + +COPY --from=builder /app/ztncui /bak/ztncui +COPY --from=builder /var/lib/zerotier-one /bak/zerotier-one +COPY --from=builder /app/ZeroTierOne/zerotier-one /usr/sbin/zerotier-one + +ADD https://github.com/kaaass/ZeroTierOne/releases/download/mkmoonworld-1.0/mkmoonworld-x86_64 /app/mkmoonworld-x86_64 + +VOLUME [ "/app/dist","/app/ztncui","/var/lib/zerotier-one","/app/config"] + +CMD ["/bin/sh","--"] \ No newline at end of file