install pip req with txt
This commit is contained in:
parent
b76adec077
commit
63e359b87d
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue