Homework

Homework — prove ephemerality, break a guard

Ship your own. Deploy your app (or your SignFlow fork) to Railway, or work through these on the reference deploy.

  1. Prove ephemerality is real. On a service with no Volume (or with UPLOAD_DIR pointing at the container disk), upload a file, redeploy, and try to download it. It's gone. Then attach the Volume, repeat, and watch it survive. Write two sentences on why the storage.Store interface made this a config decision, not a code change.

  2. Read the image. Run docker build -t signflow . locally, then docker history signflow (or check the image size). Notice how little is in the final layer. Explain what CGO_ENABLED=0 and the distroless base each contribute, and why embedding the migrations matters for a self-migrating deploy.

  3. Break a guard, watch it refuse. Deploy with APP_ENV=prod but omit BASE_URL. The app won't boot. Read the exact error. Now set APP_ENV=dev with the same missing var — it boots (with a localhost default). Explain why refusing in prod but defaulting in dev is the right split.

  4. Plan the object-storage swap. You will not implement it, but sketch it: which single file changes to add an S3Store implementing storage.Store, what stays untouched (every handler), and why a Volume was the right first choice but object storage is what you'd reach for at multiple instances. This is the interface from lesson 8 paying off.

Next lesson is the payoff of the whole curriculum: you have now built authentication two completely different ways — a JWT in Pica, a session cookie here — and you can finally feel why the answer differs.