Fix Docker setup: add gunicorn, fix permissions, update docker-compose and entrypoint, add deployment instructions

This commit is contained in:
2025-12-21 15:05:58 +03:00
parent ec02360eac
commit a55be3095b
5 changed files with 38 additions and 21 deletions

View File

@@ -149,11 +149,18 @@ EOF
# Если manage.py не в текущей директории, но есть в подпапке myproject
if [ ! -f "manage.py" ] && [ -d "myproject" ]; then
echo "Changing directory to myproject..."
cd myproject
# Устанавливаем PYTHONPATH чтобы Python мог найти модуль myproject
export PYTHONPATH=$(pwd):$PYTHONPATH
echo "PYTHONPATH set to: $PYTHONPATH"
# Пытаемся войти в директорию, перенаправляя ошибки в /dev/null
if cd myproject 2>/dev/null; then
echo "Changing directory to myproject..."
# Устанавливаем PYTHONPATH чтобы Python мог найти модуль myproject
export PYTHONPATH=$(pwd):$PYTHONPATH
echo "PYTHONPATH set to: $PYTHONPATH"
else
# Если не можем войти в директорию (проблема с правами), устанавливаем PYTHONPATH из текущей директории
echo "Warning: Cannot access myproject directory (permission denied). Setting PYTHONPATH to include myproject..."
export PYTHONPATH=/app/myproject:$PYTHONPATH
echo "PYTHONPATH set to: $PYTHONPATH"
fi
fi
case "$1" in