fix: align Docker Python version with pinned dependencies

This commit is contained in:
tifisht
2026-10-26 08:13:17 +08:00
parent da2c3d4cfc
commit fcbb409a12
4 changed files with 67 additions and 3 deletions
+64
View File
@@ -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
+1 -1
View File
@@ -1,4 +1,4 @@
FROM python:3.9.22-alpine3.21 FROM python:3.12-alpine3.23
WORKDIR /app WORKDIR /app
RUN apk add --no-cache ffmpeg RUN apk add --no-cache ffmpeg
COPY requirements.txt requirements.txt COPY requirements.txt requirements.txt
+1 -1
View File
@@ -59,7 +59,7 @@
## 🚀 快速开始 ## 🚀 快速开始
### 环境要求 ### 环境要求
- Python 3.7+ - Python 3.10+(推荐 Python 3.12,与 Docker 镜像一致)
- 网易云音乐黑胶会员账号 - 网易云音乐黑胶会员账号
### 安装步骤 ### 安装步骤
+1 -1
View File
@@ -30,7 +30,7 @@
## 🚀 快速开始 ## 🚀 快速开始
### 环境要求 ### 环境要求
- Python 3.7+ - Python 3.10+(推荐 Python 3.12,与 Docker 镜像一致)
- 网易云音乐黑胶会员账号(用于获取高音质资源) - 网易云音乐黑胶会员账号(用于获取高音质资源)
### 安装步骤 ### 安装步骤