Browse Source

fix: 🐛 移除 Dockerfile 中的多余文件复制,确保配置文件正确复制到容器

pull/29/head
chenjiale 1 month ago
parent
commit
8bc3aa3fd0
  1. 2
      .drone.yml
  2. 7
      Dockerfile

2
.drone.yml

@ -22,7 +22,7 @@ steps:
- echo "=== BUILD STAGE PWD ===" - echo "=== BUILD STAGE PWD ==="
- pwd - pwd
- ls -l - ls -l
- docker build --no-cache -t alert-python:latest -f Dockerfile . - docker build -t alert-python:latest -f Dockerfile .
- name: run python container - name: run python container
image: docker image: docker

7
Dockerfile

@ -18,8 +18,11 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
RUN rm -rf /app/config.py COPY config.py /app/config.py
COPY . . COPY app.py /app/app.py
COPY *.py /app/
COPY requirements.txt /app/
RUN mkdir -p /opt/alert/model-lab \ RUN mkdir -p /opt/alert/model-lab \
&& cp /app/config.py /opt/alert/model-lab/config.py && cp /app/config.py /opt/alert/model-lab/config.py

Loading…
Cancel
Save