diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml new file mode 100644 index 0000000..f0c706c --- /dev/null +++ b/.github/workflows/build_docker.yml @@ -0,0 +1,49 @@ +name: release_docker + +on: + push: + branches: ["main","release"] + +jobs: + release_docker: + name: Release Docker + runs-on: ubuntu-latest + 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 + uses: docker/metadata-action@v4 + with: + images: ${{ secrets.DOCKERHUB_NAME }} + + - 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 diff --git a/node-proxy/dockerfile b/dockerfile similarity index 84% rename from node-proxy/dockerfile rename to dockerfile index d121f56..29e31bd 100644 --- a/node-proxy/dockerfile +++ b/dockerfile @@ -1,14 +1,8 @@ FROM node:gallium-alpine WORKDIR /node-proxy - -COPY ./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 - EXPOSE 5344 - ENTRYPOINT ["node", "index.js"] \ No newline at end of file