diff --git a/.drone.yml b/.drone.yml index 6e92f2e..8507c9e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,26 +19,27 @@ steps: - name: dockersock path: /var/run/docker.sock commands: - - echo "=== BUILD STAGE PWD ===" - - pwd - - ls -l - - docker build -t alert-python:latest -f Dockerfile . + - docker build --no-cache -t alert-python:latest -f Dockerfile . - name: run python container image: docker volumes: - name: dockersock path: /var/run/docker.sock + - name: python-conf + path: /opt/alert/model-lab commands: - - echo "=== RUN STAGE PWD ===" - - pwd - - ls -l - - test -f $(pwd)/config.py || (echo "config.py not found" && exit 1) + - mkdir -p /opt/alert/model-lab + - cp config.py /opt/alert/model-lab/config.py - docker stop alert-python || true - docker rm alert-python || true - - 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 + - docker run -d --restart always --name alert-python --network alert-net -p 8082:8082 -v /opt/alert/model-lab/config.py:/opt/alert/model-lab/config.py:ro alert-python:latest volumes: - name: dockersock host: path: /var/run/docker.sock + + - name: python-conf + host: + path: /opt/alert/model-lab