From 99f72e0107f536a0acadeb4a2fdc97fac3246a20 Mon Sep 17 00:00:00 2001 From: Anja Freudenreich Date: Thu, 13 Feb 2025 13:47:52 +0000 Subject: [PATCH] .drone.yml aktualisiert --- .drone.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 14fbd42..c587dd3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,4 +1,3 @@ ---- kind: pipeline type: docker name: default @@ -8,9 +7,18 @@ steps: image: python:3.9-slim commands: - pip install --no-cache-dir -r requirements.txt - - python app.py & # Run the Flask app in the background - - sleep 10 # Optional: Wait for the Flask app to start before continuing (you can adjust or remove this depending on the app's startup time) + - python app.py & # Run the Flask app in the background to simulate deployment + + - name: build docker image and deploy + image: docker:20.10 # Docker image to build and run the container + services: + - name: docker + image: docker:20.10 + privileged: true # Allow Docker-in-Docker for building the image + commands: + - docker build -t my-flask-app:${DRONE_BUILD_NUMBER} . # Build Docker image + - docker run -d -p 5000:5000 my-flask-app:${DRONE_BUILD_NUMBER} # Run Flask app in container trigger: branch: - - master + - master \ No newline at end of file