From 1c1aa49e750f07a73206ed7f1dc865842fa9256f Mon Sep 17 00:00:00 2001 From: PikuZheng Date: Fri, 15 Dec 2023 14:31:44 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=87=8F=E5=B0=8F=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E4=BD=93=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 76c7b1e..bd7b792 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ -FROM python:3.10.13-slim-bullseye +FROM python:3.10-alpine WORKDIR /app -COPY . /app +COPY ./main.py /app +COPY ./common /app +COPY ./modules /app +COPY ./requirements.txt /app # 指定源, 如果后期源挂了, 更换个源就可以. RUN pip install --no-cache -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt -CMD [ "python", "main.py" ] \ No newline at end of file +CMD [ "python", "main.py" ] From 3f6100f6b9b0ab6e35a48f94c1de78785ebb9ac2 Mon Sep 17 00:00:00 2001 From: PikuZheng Date: Fri, 15 Dec 2023 14:45:53 +0800 Subject: [PATCH 2/5] Update Dockerfile --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index bd7b792..a2cf6f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,14 @@ -FROM python:3.10-alpine +FROM python:3.10-alpine WORKDIR /app -COPY ./main.py /app -COPY ./common /app -COPY ./modules /app -COPY ./requirements.txt /app +COPY ./main.py . +COPY ./common ./common +COPY ./modules ./modules +COPY ./requirements.txt . -# 指定源, 如果后期源挂了, 更换个源就可以. -RUN pip install --no-cache -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt +# ........., ....................., ...................... + +RUN pip install --no-cache-dir -r requirements.txt CMD [ "python", "main.py" ] From f0c4313e5bf0aca1bb7a4a896c3db40b663461ab Mon Sep 17 00:00:00 2001 From: PikuZheng Date: Fri, 15 Dec 2023 14:46:48 +0800 Subject: [PATCH 3/5] Update Dockerfile --- Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2cf6f9..edfdae3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,7 @@ COPY ./common ./common COPY ./modules ./modules COPY ./requirements.txt . -# ........., ....................., ...................... - -RUN pip install --no-cache-dir -r requirements.txt +# 指定源, 如果后期源挂了, 更换个源就可以. # ........., ....................., ...................... +RUN pip install --no-cache -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt CMD [ "python", "main.py" ] From 6e06b203c3c3ee81b5696828be5f551fdb2617cf Mon Sep 17 00:00:00 2001 From: PikuZheng Date: Fri, 15 Dec 2023 14:47:20 +0800 Subject: [PATCH 4/5] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index edfdae3..7206a74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ COPY ./common ./common COPY ./modules ./modules COPY ./requirements.txt . -# 指定源, 如果后期源挂了, 更换个源就可以. # ........., ....................., ...................... -RUN pip install --no-cache -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt +# 指定源, 如果后期源挂了, 更换个源就可以. +RUN pip install --no-cache -i https://pypi.mirrors.ustc.edu.cn/simple/ -r requirements.txt CMD [ "python", "main.py" ] From 7b379fba585f06859d649a43a1bad4af59455fc4 Mon Sep 17 00:00:00 2001 From: PikuZheng Date: Fri, 15 Dec 2023 14:58:22 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=BA=A0=E6=AD=A3=E5=8D=95=E5=BC=95?= =?UTF-8?q?=E5=8F=B7=E5=B5=8C=E5=A5=97=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/__init__.py b/modules/__init__.py index 55e1d72..d4a44e7 100644 --- a/modules/__init__.py +++ b/modules/__init__.py @@ -77,7 +77,7 @@ async def handleApiRequest(command, source, songId, quality): } try: result = await func(songId, quality) - logger.debug(f'获取{source}_{songId}_{quality}成功,URL:{result['url']}') + logger.debug(f'获取{source}_{songId}_{quality}成功,URL:{result["url"]}') canExpire = sourceExpirationTime[source]['expire'] expireTime = sourceExpirationTime[source]['time'] + int(time.time()) @@ -86,7 +86,7 @@ async def handleApiRequest(command, source, songId, quality): "time": expireTime, "url": result['url'], }) - logger.debug(f'缓存已更新:{source}_{songId}_{quality}, URL:{result['url']}, expire: {expireTime}') + logger.debug(f'缓存已更新:{source}_{songId}_{quality}, URL:{result["url"]}, expire: {expireTime}') return { 'code': 0,