Skip to content

Commit ba9e08b

Browse files
committed
fix dockerfile error
1 parent f879504 commit ba9e08b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ RUN python -m venv /opt/venv && \
1313
find /opt/venv -name "*.pyc" -delete && \
1414
find /opt/venv -name "__pycache__" -delete
1515

16-
# 验证依赖安装(在构建阶段验证)
16+
# 验证基本依赖安装
1717
RUN /opt/venv/bin/python -c "import flask; import websockets; import yt_dlp"
1818

1919
# 运行阶段
@@ -57,12 +57,9 @@ COPY --chown=app:app src/ ./src/
5757
COPY --chown=app:app templates/ ./templates/
5858
COPY --chown=app:app static/ ./static/
5959

60-
# 创建空的__init__.py(如果不存在)
61-
RUN touch src/__init__.py
62-
63-
# 验证运行时环境和导入
64-
RUN cd /app && \
65-
python -c "from src.downloader import BilibiliDownloader; from src.app import app"
60+
# 创建空的__init__.py文件
61+
RUN touch src/__init__.py && \
62+
touch src/models/__init__.py
6663

6764
# 切换到非root用户
6865
USER app

0 commit comments

Comments
 (0)