diff --git a/Dockerfile b/Dockerfile index 043f519..fa55b43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM python:latest # Install Supervisord -RUN pip install supervisor flask +RUN pip install supervisor # Copy your Supervisord configuration file into the container COPY supervisord.conf /etc/supervisor/supervisord.conf diff --git a/entrypoint.sh b/entrypoint.sh index 5072d3b..ab0195a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ # Check if the REPO_URL environment variable is set if [ -z "$GIT_REPO" ]; then - echo "Error: REPO_URL environment variable is not set." + echo "Error: GIT_REPO environment variable is not set." exit 1 fi @@ -19,6 +19,9 @@ else git pull origin master fi +cd "$TARGET_DIR" || exit 1 +pip install -r requirements.txt + mkdir -p /var/run/supervisor # Run your application or desired command diff --git a/githook.py b/githook.py index eb6b80c..03ac667 100644 --- a/githook.py +++ b/githook.py @@ -11,6 +11,7 @@ def githook(): try: subprocess.run(['supervisorctl', 'stop', 'app'], check=True) subprocess.run(['git', 'pull'], check=True, cwd=path) + subprocess.run(['pip', 'install', '-r', 'requirements.txt'], check=True, cwd=path) subprocess.run(['supervisorctl', 'start', 'app'], check=True) return "", 200 except Exception as e: