m64_ed4181ee0b62 / start.sh
14 lines, 719 Braw
1#!/usr/bin/env bash2# hello-world entrypoint. The container runs `bash /capsule/start.sh` with no arguments.3#4# What the container gets from m64:5# /capsule this folder, read-only6# /scratch a writable folder, also $HOME7# $M64_PORT the port to listen on (runtime.internal_port)8# $M64_STATUS a file to append progress to, one JSON object per line;9# phases: loading, warming, ready, error10set -eu11echo '{"phase":"loading","detail":"starting the hello-world server"}' >> "$M64_STATUS"12# exec: the server replaces this shell, so it gets the container's stop signal.13# -u: unbuffered, so its log lines show up in the capsule's log at once.14exec python3 -u /capsule/server.py