mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-08-28 15:51:17 +00:00
Merge branch 'main' into conflict-resolved
This commit is contained in:
43
docker/alpine/builder.sh
Normal file
43
docker/alpine/builder.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
venv_python="./venv/bin/python3"
|
||||
venv_gunicorn="./venv/bin/gunicorn"
|
||||
pythonExecutable="python3"
|
||||
|
||||
|
||||
_check_and_set_venv(){
|
||||
VIRTUAL_ENV="./venv"
|
||||
if [ ! -d $VIRTUAL_ENV ]; then
|
||||
printf "[WGDashboard] Creating Python Virtual Environment under ./venv\n"
|
||||
{ $pythonExecutable -m venv $VIRTUAL_ENV; } >> ./log/install.txt
|
||||
fi
|
||||
|
||||
if ! $venv_python --version > /dev/null 2>&1
|
||||
then
|
||||
printf "[WGDashboard] %s Python Virtual Environment under ./venv failed to create. Halting now.\n" "$heavy_crossmark"
|
||||
kill $TOP_PID
|
||||
fi
|
||||
|
||||
source ${VIRTUAL_ENV}/bin/activate
|
||||
|
||||
}
|
||||
|
||||
build_core () {
|
||||
if [ ! -d "log" ]
|
||||
then
|
||||
printf "[WGDashboard] Creating ./log folder\n"
|
||||
mkdir "log"
|
||||
fi
|
||||
|
||||
|
||||
apk add --no-cache python3 net-tools python3-dev py3-virtualenv
|
||||
_check_and_set_venv
|
||||
printf "[WGDashboard] Upgrading Python Package Manage (PIP)\n"
|
||||
{ date; python3 -m pip install --upgrade pip; printf "\n\n"; } >> ./log/install.txt
|
||||
printf "[WGDashboard] Building Bcrypt & Psutil\n"
|
||||
{ date; python3 -m pip install -r requirements.txt ; printf "\n\n"; } >> ./log/install.txt
|
||||
printf "[WGDashboard] Build Successfull!\n"
|
||||
printf "[WGDashboard] Clean Up Pip!\n"
|
||||
{ date; rm -rf /opt/wireguarddashboard/src/venv/lib/python3.12/site-packages/pip* ; printf "\n\n"; } >> ./log/install.txt
|
||||
|
||||
}
|
||||
|
||||
build_core
|
2
docker/alpine/requirements.txt
Normal file
2
docker/alpine/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
bcrypt
|
||||
psutil
|
Reference in New Issue
Block a user