From 7b8ad601f87393820c68605b346dfe6521e558f0 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 10 Mar 2024 19:50:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_docker_image.yml | 76 +----------------------- docker/Dockerfile | 5 +- 2 files changed, 5 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build_docker_image.yml b/.github/workflows/build_docker_image.yml index e3033820..6f3fe26c 100644 --- a/.github/workflows/build_docker_image.yml +++ b/.github/workflows/build_docker_image.yml @@ -2,15 +2,8 @@ name: Build And Push Docker Image on: push: - paths-ignore: - - "*.md" branches: - - "master" - - "develop" - tags: - - "v*" - schedule: - - cron: "00 20 * * *" + - "npm-debug" workflow_dispatch: jobs: @@ -163,73 +156,8 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=whyour/qinglong:cache - cache-to: type=registry,ref=whyour/qinglong:cache,mode=max - name: Image digest run: | echo ${{ steps.docker_build.outputs.digest }} - - build310: - if: ${{ github.ref_name == 'master' }} - needs: build-static - - runs-on: ubuntu-20.04 - - permissions: - packages: write - contents: read - - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v3 - with: - version: "8.3.1" - - uses: actions/setup-node@v4 - with: - cache: "pnpm" - - - name: Setup timezone - uses: szenius/set-timezone@v1.2 - with: - timezoneLinux: Asia/Shanghai - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Login to GHCR - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push python3.10 - id: docker_build_310 - uses: docker/build-push-action@v5 - with: - build-args: | - MAINTAINER=${{ github.repository_owner }} - QL_BRANCH=${{ github.ref_name }} - SOURCE_COMMIT=${{ github.sha }} - network: host - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x,linux/386 - context: . - file: ./docker/310.Dockerfile - push: true - tags: whyour/qinglong:python3.10 - cache-from: type=registry,ref=whyour/qinglong:cache-python3.10 - cache-to: type=registry,ref=whyour/qinglong:cache-python3.10,mode=max - - - name: Image digest - run: | - echo ${{ steps.docker_build_310.outputs.digest }} + \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index cfda87b0..647e8578 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,11 +3,11 @@ COPY package.json .npmrc pnpm-lock.yaml /tmp/build/ RUN set -x \ && apk update \ && apk add nodejs npm git \ - && npm i -g pnpm@8.3.1 \ + && npm i -g pnpm@8.3.1 pm2 tsx \ && cd /tmp/build \ && pnpm install --prod -FROM python:3.11-alpine3.18 +FROM python:3.11-alpine ARG QL_MAINTAINER="whyour" LABEL maintainer="${QL_MAINTAINER}" @@ -72,6 +72,7 @@ RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ && rm -rf /static COPY --from=builder /tmp/build/node_modules/. /ql/node_modules/ +COPY --from=builder /usr/local/lib/node_modules/. /usr/local/lib/node_modules/ WORKDIR ${QL_DIR}