From fcbb409a12ebba0bd8401e84e0074d65963f01fc Mon Sep 17 00:00:00 2001 From: tifisht Date: Mon, 26 Oct 2026 08:13:17 +0800 Subject: [PATCH 1/3] fix: align Docker Python version with pinned dependencies --- .github/workflows/docker-smoke.yml | 64 ++++++++++++++++++++++++++++++ Dockerfile | 2 +- README.md | 2 +- 使用文档.md | 2 +- 4 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docker-smoke.yml diff --git a/.github/workflows/docker-smoke.yml b/.github/workflows/docker-smoke.yml new file mode 100644 index 0000000..6788c16 --- /dev/null +++ b/.github/workflows/docker-smoke.yml @@ -0,0 +1,64 @@ +name: Docker smoke test + +on: + push: + paths: + - Dockerfile + - .dockerignore + - docker-compose.yml + - entrypoint.sh + - requirements.txt + - '*.py' + - templates/** + - .github/workflows/docker-smoke.yml + pull_request: + paths: + - Dockerfile + - .dockerignore + - docker-compose.yml + - entrypoint.sh + - requirements.txt + - '*.py' + - templates/** + - .github/workflows/docker-smoke.yml + workflow_dispatch: + +permissions: + contents: read + +jobs: + build-and-start: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - name: Build image and check dependencies + run: | + docker build --tag netease-url:smoke . + docker run --rm netease-url:smoke python3 -m pip check + docker run --rm netease-url:smoke ffmpeg -version + + - name: Start service without account credentials + run: | + touch "$RUNNER_TEMP/netease-cookie.txt" + docker run --detach --name netease-url-smoke \ + --publish 127.0.0.1:5000:5000 \ + --mount "type=bind,src=$RUNNER_TEMP/netease-cookie.txt,dst=/app/cookie.txt,readonly" \ + netease-url:smoke + curl --fail --silent --show-error --retry 30 --retry-connrefused \ + --retry-delay 1 --max-time 5 http://127.0.0.1:5000/health > health.json + python3 - <<'PY' + import json + with open('health.json') as response: + health = json.load(response) + assert health['success'] is True, health + assert health['data']['service'] == 'running', health + assert health['data']['cookie_count'] == 0, health + PY + + - name: Show service logs and remove container + if: always() + run: | + docker logs netease-url-smoke 2>/dev/null || true + docker rm --force netease-url-smoke 2>/dev/null || true diff --git a/Dockerfile b/Dockerfile index d72206f..3953c3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9.22-alpine3.21 +FROM python:3.12-alpine3.23 WORKDIR /app RUN apk add --no-cache ffmpeg COPY requirements.txt requirements.txt diff --git a/README.md b/README.md index ecadb27..d3f20fa 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ ## 🚀 快速开始 ### 环境要求 -- Python 3.7+ +- Python 3.10+(推荐 Python 3.12,与 Docker 镜像一致) - 网易云音乐黑胶会员账号 ### 安装步骤 diff --git a/使用文档.md b/使用文档.md index 220a216..25e2138 100644 --- a/使用文档.md +++ b/使用文档.md @@ -30,7 +30,7 @@ ## 🚀 快速开始 ### 环境要求 -- Python 3.7+ +- Python 3.10+(推荐 Python 3.12,与 Docker 镜像一致) - 网易云音乐黑胶会员账号(用于获取高音质资源) ### 安装步骤 From 0e3af032e721b4216da508d0cad74ae6fa8d4b00 Mon Sep 17 00:00:00 2001 From: tifisht Date: Mon, 26 Oct 2026 08:15:28 +0800 Subject: [PATCH 2/3] test: wait for Docker service readiness --- .github/workflows/docker-smoke.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-smoke.yml b/.github/workflows/docker-smoke.yml index 6788c16..b64ddf4 100644 --- a/.github/workflows/docker-smoke.yml +++ b/.github/workflows/docker-smoke.yml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build image and check dependencies run: | @@ -46,8 +46,9 @@ jobs: --publish 127.0.0.1:5000:5000 \ --mount "type=bind,src=$RUNNER_TEMP/netease-cookie.txt,dst=/app/cookie.txt,readonly" \ netease-url:smoke - curl --fail --silent --show-error --retry 30 --retry-connrefused \ - --retry-delay 1 --max-time 5 http://127.0.0.1:5000/health > health.json + curl --fail --silent --show-error --retry 30 --retry-all-errors \ + --retry-delay 1 --retry-max-time 60 --max-time 5 \ + --output health.json http://127.0.0.1:5000/health python3 - <<'PY' import json with open('health.json') as response: From 34087874de4ee0d426649a474b5d42e8cc877cfb Mon Sep 17 00:00:00 2001 From: tifisht Date: Mon, 26 Oct 2026 08:22:06 +0800 Subject: [PATCH 3/3] chore: remove Docker smoke workflow from contribution --- .github/workflows/docker-smoke.yml | 65 ------------------------------ 1 file changed, 65 deletions(-) delete mode 100644 .github/workflows/docker-smoke.yml diff --git a/.github/workflows/docker-smoke.yml b/.github/workflows/docker-smoke.yml deleted file mode 100644 index b64ddf4..0000000 --- a/.github/workflows/docker-smoke.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Docker smoke test - -on: - push: - paths: - - Dockerfile - - .dockerignore - - docker-compose.yml - - entrypoint.sh - - requirements.txt - - '*.py' - - templates/** - - .github/workflows/docker-smoke.yml - pull_request: - paths: - - Dockerfile - - .dockerignore - - docker-compose.yml - - entrypoint.sh - - requirements.txt - - '*.py' - - templates/** - - .github/workflows/docker-smoke.yml - workflow_dispatch: - -permissions: - contents: read - -jobs: - build-and-start: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v6 - - - name: Build image and check dependencies - run: | - docker build --tag netease-url:smoke . - docker run --rm netease-url:smoke python3 -m pip check - docker run --rm netease-url:smoke ffmpeg -version - - - name: Start service without account credentials - run: | - touch "$RUNNER_TEMP/netease-cookie.txt" - docker run --detach --name netease-url-smoke \ - --publish 127.0.0.1:5000:5000 \ - --mount "type=bind,src=$RUNNER_TEMP/netease-cookie.txt,dst=/app/cookie.txt,readonly" \ - netease-url:smoke - curl --fail --silent --show-error --retry 30 --retry-all-errors \ - --retry-delay 1 --retry-max-time 60 --max-time 5 \ - --output health.json http://127.0.0.1:5000/health - python3 - <<'PY' - import json - with open('health.json') as response: - health = json.load(response) - assert health['success'] is True, health - assert health['data']['service'] == 'running', health - assert health['data']['cookie_count'] == 0, health - PY - - - name: Show service logs and remove container - if: always() - run: | - docker logs netease-url-smoke 2>/dev/null || true - docker rm --force netease-url-smoke 2>/dev/null || true