install pip req with txt

This commit is contained in:
null 2024-02-19 07:35:57 +01:00
parent b76adec077
commit 63e359b87d
3 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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: