Skip to content

12. Pretzel Shop on the Public Internet, on a 1GB Free-Tier VM

Why Oracle, and why it didn’t go as planned

Section titled “Why Oracle, and why it didn’t go as planned”

The lesson’s default options are AWS, Azure, GCP, and DigitalOcean — all fine, none genuinely free without either a time-boxed trial or a credit card hold. Oracle’s Always Free tier is the one that’s actually free forever with no prepayment gate, so that’s the one I used. The catch showed up immediately: the free ARM shape matching the lesson’s own spec (VM.Standard.A1.Flex, 2 OCPU/4GB) is popular enough that Oracle rations it. A retry script polling for capacity in Sydney ran over 100 attempts across 13+ hours without ever landing a slot.

The fallback, VM.Standard.E2.1.Micro, is Oracle’s other Always Free shape — always available, no rationing, but 1 OCPU/1GB, well under what four containers plus image builds usually want. Getting the full stack running there anyway, rather than waiting indefinitely on a shape that might never free up, ended up being the more interesting exercise than the original plan.

A swapfile as an OOM buffer, then explicit memory tuning rather than trusting defaults sized for a bigger box: Postgres capped at shared_buffers=64MB/max_connections=20, Redis capped at maxmemory 64mb with LRU eviction, and hard memory limits on both application containers. The single riskiest moment — the frontend’s multi-stage Docker build, which needs real headroom to compile — took about three minutes on this box instead of the usual handful of seconds, but completed cleanly with no OOM kill once swap was in place.

A real gap in the reference repo, not a config mistake

Section titled “A real gap in the reference repo, not a config mistake”

Following the exact clone command from the lesson produced no configuration file provided: not found on the very first docker compose up. The public reference repo genuinely only ships backend/docker-compose.yml — Postgres and Redis, nothing else. The root-level Compose file wiring in the backend and frontend services is something built up over Lessons 4 and 5 and expected to already exist in whatever fork carried that work forward — a fresh clone of the upstream repo was never going to have it. Fix was straightforward once identified: clone the actual working fork instead, with a fresh SSH keypair generated on the new VM specifically for GitHub access, rather than trying to reconstruct the missing file from scratch.

Two separate firewalls, and a subtle Compose override bug

Section titled “Two separate firewalls, and a subtle Compose override bug”

Oracle layers two independent firewalls — the cloud-level Security List (VCN-wide, console-managed) and the guest OS’s own iptables rules inside the VM itself. Both needed opening for ports 80 and 3001; missing either one produces the identical symptom of “connection refused” with no indication which layer is actually blocking it.

Separately, the app’s Compose file references an external pretzel_observability network for the Lesson 9 telemetry stack — not deployed on this cloud VM. The natural fix, adding driver: bridge in an override file, didn’t actually work: Compose keeps external: true from the base file even when a driver is added on top in an override. The network reference needed an explicit external: false before Compose would create it locally instead of searching for one that didn’t exist.

Verifying it for real, not just “it’s up”

Section titled “Verifying it for real, not just “it’s up””

docker compose ps showing four healthy containers isn’t the actual test — the lesson’s own warning is that CORS and the frontend’s build-time API URL are the two things that silently break a cart while the homepage still loads fine. Confirmed instead from an entirely separate machine: curl returning frontend HTTP 200 and a clean /health JSON response, then a full browser pass — load the page, add an item, watch the cart count actually increment. That’s the failure mode the lesson explicitly warns about, and it didn’t happen.

A single VM is one failure domain — no sibling instance to fail over to, no control plane to respawn a crashed container. What separates a lab exercise from something a team would actually run is boring discipline: billing alerts, automated volume backups, a documented patch cadence, and knowing exactly which ports are reachable from the entire internet versus which ones only look that way until someone checks both firewall layers.


Next: Lesson 13, Automated Deployments.