#!/usr/bin/env bash set -e # ── 1. Move (or copy) everything to a writable scratch dir ──────────────── mkdir -p /tmp/app cp -r /app/. /tmp/app/ # use mv if you prefer # ── 2. Delete the original build-layer copy ─────────────────────────────── rm -rf /app/* # or rm /app/app.py if you only want that file # (Optional) show that the delete really happened echo "[entrypoint] Deleted original /app, now running from /tmp/app" # ── 3. Run Uvicorn from the copy ────────────────────────────────────────── cd /tmp/app exec uvicorn app:app --host 0.0.0.0 --port 7860 # exec python /tmp/app.py