This repository has been archived on 2026-10-02. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
NeteaseUrl/Dockerfile
T
snowy-yang d209af847a chore: 基线快照 —— 纳入 git 版本控制(站点 v2.4.0 / Flask 单体)
在框架迁移与模块拆分前保存当前可运行状态:
- 后端:main.py/auth_routes.py/auth_system.py/music_api.py/music_downloader.py/podcast_api.py/qr_login.py
- 前端:templates/index.html + static/site_auth.js
- 部署:Dockerfile/docker-compose.yml/entrypoint.sh/requirements.txt
敏感数据(data/、cookie.txt)与内部文档(交接文档/新会话引导)按 .gitignore 排除。
2026-09-26 00:13:05 +08:00

24 lines
1.3 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# T7:基础镜像升级到 Python 3.12(3.9 已于 2025-10 EOL);alpine + ffmpeg 组合保持不变
FROM python:3.12-alpine3.21
WORKDIR /app
# 使用阿里云 apk 镜像源加速安装 ffmpeg
# 第 97 条(P3):补 tzdata——alpine 无 zoneinfo,ENV TZ=Asia/Shanghai 不装它不生效
# (容器内日志/展示本地时间差 8 小时;计费/会话全部 epoch 秒不受影响)
RUN sed -i 's|dl-cdn.alpinelinux.org|mirrors.aliyun.com|g' /etc/apk/repositories && \
apk add --no-cache tzdata ffmpeg
COPY requirements.txt requirements.txt
RUN pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
pip3 install --no-cache-dir -r requirements.txt
COPY . .
RUN chmod +x /app/entrypoint.sh
# 非 root 运行(容器安全基线)。注:挂载卷 ./downloads ./data 的宿主机目录
# 需对 UID 10001 可写(见 docker-compose.yml 注释),否则下载与数据库写入会失败
RUN adduser -D -u 10001 appuser && chown -R appuser:appuser /app
USER appuser
ENV TZ=Asia/Shanghai
EXPOSE 5000
# 容器健康检查(/health 为轻量本地端点,不触发上游请求)
HEALTHCHECK --interval=60s --timeout=5s --start-period=20s --retries=3 \
CMD wget -qO- http://127.0.0.1:5000/health || exit 1
CMD ["/app/entrypoint.sh"]