Spaces:
Running
Running
Update entrypoint.sh
Browse files- entrypoint.sh +4 -12
entrypoint.sh
CHANGED
@@ -1,22 +1,14 @@
|
|
1 |
#!/usr/bin/env bash
|
2 |
set -e
|
3 |
|
4 |
-
|
5 |
-
mkdir -p /tmp/runner
|
6 |
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
# 2) Unpack and launch from the copy
|
11 |
-
tar -xzf /tmp/runner/app.tgz -C /tmp/runner # -> app.pyc
|
12 |
python /tmp/runner/app.pyc &
|
13 |
PID=$!
|
14 |
|
15 |
-
# 3) Give Python a moment to import, then wipe both the unpacked .pyc **and**
|
16 |
-
# the tarball copy that lives on the writable layer.
|
17 |
sleep 2
|
18 |
-
rm -f /tmp/runner/app.pyc
|
19 |
-
echo "[entrypoint] byte-code and tarball copy deleted"
|
20 |
-
|
21 |
-
# 4) Re-attach to the FastAPI process
|
22 |
wait "$PID"
|
|
|
1 |
#!/usr/bin/env bash
|
2 |
set -e
|
3 |
|
4 |
+
B64="PUT-YOUR-BASE64-OF-app.pyc-HERE"
|
|
|
5 |
|
6 |
+
mkdir -p /tmp/runner
|
7 |
+
echo "$B64" | base64 -d > /tmp/runner/app.pyc
|
8 |
|
|
|
|
|
9 |
python /tmp/runner/app.pyc &
|
10 |
PID=$!
|
11 |
|
|
|
|
|
12 |
sleep 2
|
13 |
+
rm -f /tmp/runner/app.pyc
|
|
|
|
|
|
|
14 |
wait "$PID"
|