logging_bot / entrypoint.sh
AstraOS's picture
Update entrypoint.sh
8d833f7 verified
raw
history blame
479 Bytes
#!/usr/bin/env bash
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"