From 4d25f045f5c48ee1f611925f88c1bb88e4dad1a8 Mon Sep 17 00:00:00 2001 From: "haha.wang" Date: Thu, 14 Sep 2023 20:34:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9dockerfile=E6=9E=84?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- node-proxy/dockerfile => dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename node-proxy/dockerfile => dockerfile (57%) diff --git a/node-proxy/dockerfile b/dockerfile similarity index 57% rename from node-proxy/dockerfile rename to dockerfile index d121f56..3c88894 100644 --- a/node-proxy/dockerfile +++ b/dockerfile @@ -1,14 +1,13 @@ +FROM node:gallium-alpine AS backend +WORKDIR /build +COPY node-proxy/. . +RUN npm i && npm run webpack + FROM node:gallium-alpine WORKDIR /node-proxy - -COPY ./dist /node-proxy - +COPY --from=backend /build/dist /node-proxy RUN pwd - RUN ls -la - RUN rm -rf /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime - EXPOSE 5344 - ENTRYPOINT ["node", "index.js"] \ No newline at end of file From 4fd51c74aa9cbdce5428329189d253d274f446c8 Mon Sep 17 00:00:00 2001 From: "haha.wang" Date: Thu, 14 Sep 2023 20:37:18 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0docker=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_docker.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build_docker.yml diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml new file mode 100644 index 0000000..eb8ec6f --- /dev/null +++ b/.github/workflows/build_docker.yml @@ -0,0 +1,41 @@ +name: release_docker + +on: + push: + branches: ["master"] + +jobs: + release_docker: + name: Release Docker + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: wangjinhai68/alist-encryptiont + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: wangjinhai68 + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64,linux/arm/v7 \ No newline at end of file From 5b9351a4eb9e27e62837e0c1e7f3b1bbc77aeb3f Mon Sep 17 00:00:00 2001 From: "haha.wang" Date: Thu, 14 Sep 2023 20:38:04 +0800 Subject: [PATCH 3/6] change main --- .github/workflows/build_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index eb8ec6f..5c6dc17 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -2,7 +2,7 @@ name: release_docker on: push: - branches: ["master"] + branches: ["main"] jobs: release_docker: From 5c052073ac27f0acb8d67068d8280330d26e8811 Mon Sep 17 00:00:00 2001 From: "haha.wang" Date: Thu, 14 Sep 2023 20:45:51 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B7=A8=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_docker.yml | 10 +++++++++- dockerfile | 7 +------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 5c6dc17..4517f08 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -2,7 +2,7 @@ name: release_docker on: push: - branches: ["main"] + branches: ["main","relase"] jobs: release_docker: @@ -11,6 +11,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Build + run: | + cd node-proxy + npm install && npm run build - name: Docker meta id: meta diff --git a/dockerfile b/dockerfile index 3c88894..29e31bd 100644 --- a/dockerfile +++ b/dockerfile @@ -1,11 +1,6 @@ -FROM node:gallium-alpine AS backend -WORKDIR /build -COPY node-proxy/. . -RUN npm i && npm run webpack - FROM node:gallium-alpine WORKDIR /node-proxy -COPY --from=backend /build/dist /node-proxy +COPY node-proxy/dist /node-proxy RUN pwd RUN ls -la RUN rm -rf /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime From b0ff2e6172ec6645e0f4b68d4fbb30eb7279e54a Mon Sep 17 00:00:00 2001 From: "haha.wang" Date: Sat, 30 Sep 2023 15:13:25 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E5=8F=98=E9=87=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index 4517f08..c9ce2c6 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -24,7 +24,7 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: wangjinhai68/alist-encryptiont + images: ${{ secrets.DOCKERHUB_NAME }} - name: Set up QEMU uses: docker/setup-qemu-action@v2 From ad7cc2f77fb84b5fa0a0f5160983fc08aff1d4ad Mon Sep 17 00:00:00 2001 From: "haha.wang" Date: Sat, 30 Sep 2023 16:02:47 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=BC=E5=86=99?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index c9ce2c6..f0c706c 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -2,7 +2,7 @@ name: release_docker on: push: - branches: ["main","relase"] + branches: ["main","release"] jobs: release_docker: