Spaces:
Running
Running
File size: 426 Bytes
f1586a0 07fa2d7 874a566 07fa2d7 874a566 07fa2d7 874a566 07fa2d7 874a566 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/usr/bin/env bash
set -e
# 1) Unpack the code into a writable overlay (tmpfs)
mkdir -p /tmp/runner
tar -xzf /app/app.tgz -C /tmp/runner # gives /tmp/runner/app.pyc
# 2) Run Python on that copy
python /tmp/runner/app.pyc &
PID=$!
# 3) Wait a moment, then unlink the byte-code and the tarball itself
sleep 2
rm -f /tmp/runner/app.pyc /app/app.tgz
echo "[entrypoint] Code deleted"
# 4) Reap the process
wait $PID
|