Skip to content

Commit c10090b

Browse files
committed
2 parents 34f4ecd + c016968 commit c10090b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

labapp/labapp_installer.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ mkdir -p "$APPDIR" "$SCRIPTDIR"
2626
cat <<EOF >"$SCRIPTDIR/start_app.sh"
2727
#!/bin/bash
2828
29-
# Ensure the directory exists and pull or clone repo
30-
if [ ! -d "\$APPDIR/.git" ]; then
31-
git clone --branch $BRANCH $REPO_URL "$APPDIR"
29+
# Navigate to the app directory
30+
cd "$APPDIR"
31+
32+
# Check if the directory is a git repository and if not, clone it
33+
if [ ! -d ".git" ]; then
34+
git clone --branch $BRANCH $REPO_URL .
3235
else
33-
cd "$APPDIR"
36+
# Reset repository to match the remote repository
3437
git remote set-url origin $REPO_URL
3538
git fetch --prune
3639
git checkout $BRANCH
@@ -39,10 +42,10 @@ else
3942
fi
4043
4144
# Install required Python packages
42-
pip3 install -r requirements.txt
45+
pip3 install -r labapp/app/requirements.txt
4346
4447
# Start the Gunicorn server
45-
gunicorn --workers 4 --bind 0.0.0.0:1337 app:app
48+
export UDF="true" && gunicorn --workers 4 --chdir labapp/app --bind 0.0.0.0:1337 app:app
4649
EOF
4750

4851
chmod +x "$SCRIPTDIR/start_app.sh"
@@ -66,6 +69,5 @@ EOF
6669
# Reload systemd to recognize new service, enable it
6770
systemctl daemon-reload
6871
systemctl enable mcn-practical-labapp.service
69-
systemctl start mcn-practical-labapp.service
7072

7173
echo "mcn-practical-labapp.service has been installed."

0 commit comments

Comments
 (0)