Browse Source

fix: 🐛 修正 Docker 容器启动命令中的配置文件路径,确保正确挂载配置

pull/24/head
chenjiale 1 month ago
parent
commit
25f1b216f9
  1. 10
      .drone.yml

10
.drone.yml

@ -30,9 +30,13 @@ steps:
commands:
- docker stop alert-python || true
- docker rm alert-python || true
# 直接挂载配置文件到容器内的 /opt/alert/model-lab/config.py(同时覆写 /app/config.py)
- docker run -d --restart always --name alert-python --network alert-net -p 8082:8082 -v $(pwd)/config.py:/opt/alert/model-lab/config.py:ro -v $(pwd)/config.py:/app/config.py:ro alert-python:latest
# 防止目录误判(保险措施,不加也可以)
- test -f $(pwd)/model-lab/config.py || exit 1
- docker run -d --restart always --name alert-python --network alert-net \
-p 8082:8082 \
-v $(pwd)/model-lab/config.py:/opt/alert/model-lab/config.py:ro \
-v $(pwd)/model-lab/config.py:/app/config.py:ro \
alert-python:latest
volumes:
- name: dockersock
host:

Loading…
Cancel
Save