#!/usr/bin/env bash # hello-world entrypoint. The container runs `bash /capsule/start.sh` with no arguments. # # What the container gets from m64: # /capsule this folder, read-only # /scratch a writable folder, also $HOME # $M64_PORT the port to listen on (runtime.internal_port) # $M64_STATUS a file to append progress to, one JSON object per line; # phases: loading, warming, ready, error set -eu echo '{"phase":"loading","detail":"starting the hello-world server"}' >> "$M64_STATUS" # exec: the server replaces this shell, so it gets the container's stop signal. # -u: unbuffered, so its log lines show up in the capsule's log at once. exec python3 -u /capsule/server.py