AstraOS commited on
Commit
07fa2d7
Β·
verified Β·
1 Parent(s): e1a9b78

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +16 -2
entrypoint.sh CHANGED
@@ -1,4 +1,18 @@
1
  #!/usr/bin/env bash
2
  set -e
3
- cp /app/app.py /tmp/app.py
4
- exec python /tmp/app.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/usr/bin/env bash
2
  set -e
3
+
4
+ # ── 1. Move (or copy) everything to a writable scratch dir ────────────────
5
+ mkdir -p /tmp/app
6
+ cp -r /app/. /tmp/app/ # use mv if you prefer
7
+
8
+ # ── 2. Delete the original build-layer copy ───────────────────────────────
9
+ rm -rf /app/* # or rm /app/app.py if you only want that file
10
+
11
+ # (Optional) show that the delete really happened
12
+ echo "[entrypoint] Deleted original /app, now running from /tmp/app"
13
+
14
+ # ── 3. Run Uvicorn from the copy ──────────────────────────────────────────
15
+ cd /tmp/app
16
+ exec uvicorn app:app --host 0.0.0.0 --port 7860
17
+
18
+ # exec python /tmp/app.py