Startup.sh not found
I'm trying to deploy a simple django app.
When I deploy it vanilla (i.e. use Azure extension on VSCode) and deploy it, it does not seem to do any collectstatic, and as a result whitenoise complains all the files aren't found.
So I think I need to create a startup.sh like this to be able to run collectstatic, as well as migrations:
#!/bin/bash
# run collectstatic
pip install --upgrade pip
pip install -r requirements.txt
npm installnpm run build
python manage.py collectstatic --noinput
python manage.py makemigrationspython
manage.py migrate
gunicorn --bind 0.0.0.0 --workers 1 --threads 8 --timeout 600 myappmodule.wsgi:application
I named it startup.sh
and put it in my root directory of my project. Also gave it chmod +x
and permissions look good. -rwxr-xr-x
I then specified the startup command to be startup.sh
I tried it both via the general settings > startup command, and I tried it also in
az webapp config set --name $APPNAME --resource-group $RESOURCEGROUP --startup-file "startup.sh"
But I keep running into this:
2023-07-09T19:27:53.203141399Z /opt/startup/startup.sh: 23: /opt/startup/startup.sh: startup.sh: not found
Been trying to deploy for a week now and keep getting stuck; hoping for any help.
I did the stack overflow thing of substituting the newlines and also tried to rename it to something else (to mystartup.sh), because it seems like there's another startup.sh inside /opt/startup. But it just complains that mystartup.sh isn't found in that case.