This is probably because the directory containing gunicorn is not present in the $PATH. I’m not sure where it’s installed, but it might be worth either specifying an absolute path for it or adding its containing directory to your $PATH (probably in the Dockerfile).
Secrets are not available at build time. However, you can use:
fly deploy -e SECRET_KEY=xxx -e ANOTHER_SECRET=zzz
to make the env vars available at build time.
It’s worth noting ARGs are different than ENV and you can set them at build time with:
fly deploy --build-arg JWT_SECRET=xxx
This could be caused by failed deployments rolling back secrets that were set. Is SECRET_KEY present if you fly secrets list?