SCGR commited on
Commit
57c5969
·
1 Parent(s): 4117d7e

Use entrypoint; fix PORT expansion

Browse files
py_backend/.gitattributes ADDED
Binary file (38 Bytes). View file
 
py_backend/entrypoint.sh CHANGED
@@ -1,9 +1,9 @@
1
  #!/usr/bin/env bash
2
- set -e
3
 
4
- # show the DB host (redacts password automatically in our echo)
5
  echo "Running alembic upgrade head..."
6
- alembic upgrade head || { echo "Alembic failed"; exit 1; }
7
 
8
- # start app (use the port Spaces injects)
9
- exec uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-7860}
 
 
1
  #!/usr/bin/env bash
2
+ set -euo pipefail
3
 
 
4
  echo "Running alembic upgrade head..."
5
+ alembic upgrade head
6
 
7
+ PORT_TO_USE="${PORT:-7860}"
8
+ echo "Starting server on port ${PORT_TO_USE}"
9
+ exec uvicorn app.main:app --host 0.0.0.0 --port "${PORT_TO_USE}"