Spaces:
Running
Running
Use entrypoint; fix PORT expansion
Browse files- py_backend/.gitattributes +0 -0
- py_backend/entrypoint.sh +5 -5
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 -
|
| 3 |
|
| 4 |
-
# show the DB host (redacts password automatically in our echo)
|
| 5 |
echo "Running alembic upgrade head..."
|
| 6 |
-
alembic upgrade head
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
| 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}"
|