Skip to content

Commit

Permalink
feat: Add debugpy as optional to entrypoint script if DEBUG env varia…
Browse files Browse the repository at this point in the history
…ble is set to anything.
  • Loading branch information
centerionware authored and Gaisberg committed Oct 3, 2024
1 parent 667e884 commit 24904fc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,16 @@ echo "Container Initialization complete."

echo "Starting Riven (Backend)..."
if [ "$PUID" = "0" ]; then
cd /riven/src && poetry run python3 main.py
if [ "${DEBUG}" != "" ]; then # check if DEBUG is set to a truthy value
cd /riven/src && poetry add debugpy && poetry run python3 -m debugpy --listen 0.0.0.0:5678 main.py
else
cd /riven/src && poetry run python3 main.py
fi
else
su -m "$USERNAME" -c "cd /riven/src && poetry run python3 main.py"
if [ "${DEBUG}" != "" ]; then # check if DEBUG is set to a truthy value
poetry add debugpy
exec su -m $USERNAME -c "cd /riven/src && poetry run python3 -m debugpy --listen 0.0.0.0:5678 main.py"
else
su -m "$USERNAME" -c "cd /riven/src && poetry run python3 main.py"
fi
fi

0 comments on commit 24904fc

Please sign in to comment.