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 FROM python:latest
# Install Supervisord # Install Supervisord
RUN pip install supervisor flask RUN pip install supervisor
# Copy your Supervisord configuration file into the container # Copy your Supervisord configuration file into the container
COPY supervisord.conf /etc/supervisor/supervisord.conf COPY supervisord.conf /etc/supervisor/supervisord.conf

View File

@ -2,7 +2,7 @@
# Check if the REPO_URL environment variable is set # Check if the REPO_URL environment variable is set
if [ -z "$GIT_REPO" ]; then 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 exit 1
fi fi
@ -19,6 +19,9 @@ else
git pull origin master git pull origin master
fi fi
cd "$TARGET_DIR" || exit 1
pip install -r requirements.txt
mkdir -p /var/run/supervisor mkdir -p /var/run/supervisor
# Run your application or desired command # Run your application or desired command

View File

@ -11,6 +11,7 @@ def githook():
try: try:
subprocess.run(['supervisorctl', 'stop', 'app'], check=True) subprocess.run(['supervisorctl', 'stop', 'app'], check=True)
subprocess.run(['git', 'pull'], check=True, cwd=path) 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) subprocess.run(['supervisorctl', 'start', 'app'], check=True)
return "", 200 return "", 200
except Exception as e: except Exception as e: