github.com/ddev/ddev@v1.23.2-0.20240519125000-d824ffe36ff3/containers/ddev-webserver/ddev-webserver-base-scripts/functions.sh (about)

     1  #!/bin/bash
     2  
     3  function ddev_custom_init_scripts {
     4    echo "Loading custom entrypoint config from ${DDEV_WEB_ENTRYPOINT}";
     5    if ls ${DDEV_WEB_ENTRYPOINT}/*.sh >/dev/null 2>&1; then
     6      for f in ${DDEV_WEB_ENTRYPOINT}/*.sh; do
     7        echo "sourcing $f"
     8        source "$f"
     9      done
    10    fi
    11  #      touch "${DDEV_WEB_ENTRYPOINT}/.user_scripts_initialized"
    12  }
    13  
    14  # Set up things that gunicorn and project may need, venv
    15  function ddev_python_setup {
    16    set -e
    17    if [ "${DDEV_WEBSERVER_TYPE}" = "nginx-gunicorn" ]; then
    18      python -m venv /var/www/html/.ddev/.venv
    19      source /var/www/html/.ddev/.venv/bin/activate
    20      pip install wheel
    21      pip install django gunicorn psycopg2-binary
    22      if [ -f /var/www/html/requirements.txt ]; then
    23        pip install -r /var/www/html/requirements.txt || true
    24      elif [ -f /var/www/html/pyproject.toml ]; then
    25        pip install /var/www/html || true
    26      fi
    27    fi
    28    set +e
    29  }