xueyiming 1 неделя назад
Родитель
Сommit
be28f1004c
2 измененных файлов с 22 добавлено и 11 удалено
  1. 20 9
      .dockerignore
  2. 2 2
      Dockerfile

+ 20 - 9
.dockerignore

@@ -1,9 +1,20 @@
-# 白名单模式:默认忽略一切,只放行镜像构建所需文件。
-# 避免 Jenkins 工作区里的 .venv、html、脚本输出等大文件进入 build context。
-*
-!Dockerfile
-!app
-!app/**
-!requirements.txt
-**/__pycache__
-**/*.pyc
+.venv
+.git
+.idea
+__pycache__
+*.py[cod]
+*.pyo
+*.pyd
+.Python
+*.egg-info
+dist
+build
+.pytest_cache
+.mypy_cache
+.ruff_cache
+*.html
+.DS_Store
+.env
+.env.*
+*.log
+terminals

+ 2 - 2
Dockerfile

@@ -20,8 +20,8 @@ COPY requirements.txt /app/requirements.txt
 RUN pip install --no-cache-dir --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/ && \
     pip install --no-cache-dir -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
 
-# 2) 复制运行所需源码,避免工作区临时文件进入镜像
-COPY app /app/app
+# 2) 复制源码
+COPY . /app
 
 # 定时任务调度:热点搜索(6/12/18) + 解构后处理(30分钟) + ODPS 需求表写入
 CMD ["python", "-m", "app.scheduler"]