Spaces:
Paused
Paused
| set -euo pipefail | |
| this="$0" # /entrypoint.sh | |
| tmp="$(mktemp)" # writable copy for the Python artefacts | |
| # 0) Prevent a second copy of the script from being run later | |
| ( sleep 1 && rm -f "$this" ) & | |
| # 1) Runtime workspace | |
| mkdir -p /tmp/runner | |
| cp /app/app.tgz /tmp/runner/ | |
| # 2) Unpack, launch, cleanup | |
| tar -xzf /tmp/runner/app.tgz -C /tmp/runner | |
| python /tmp/runner/app.pyc & | |
| pid=$! | |
| sleep 2 | |
| rm -f /tmp/runner/app.pyc /tmp/runner/app.tgz | |
| wait "$pid" | |