File size: 451 Bytes
f1586a0
 
07fa2d7
57a39f3
874a566
57a39f3
07fa2d7
57a39f3
874a566
 
57a39f3
 
874a566
 
57a39f3
07fa2d7
57a39f3
 
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 byte-code into a writable tmpfs layer
mkdir -p /tmp/runner
tar -xzf /app/app.tgz -C /tmp/runner        # -> /tmp/runner/app.pyc

# 2) Start the service from that copy
python /tmp/runner/app.pyc &
PID=$!

# 3) After a short grace period, delete both the unpacked .pyc and the tarball
sleep 2
rm -f /tmp/runner/app.pyc /app/app.tgz
echo "[entrypoint] byte-code deleted"

# 4) Re-attach to the service
wait "$PID"