Code Nexus
CurriculumHow we teachPricingBlogAboutContact
Start learning
  1. Curriculum
  2. /
  3. Season 7
  4. /
  5. Episode 2

Season 7: It Worked on My Laptop · Episode 2 of 8

Where Did the Data Go?

You play: Junior AI Developer

Included with Core programme and Certification prep
See plans

The situation

Kabelo restarted the Code Nexus Assist container on the new staging host to pick up a config change. It came back up looking healthy, and then two things were wrong. The results page, which held 41 saved results an hour earlier, was empty. And the service was logging an error about its database, which it had been reaching without trouble on the old host. Nothing in the code changed. Amara wants two numbers before anyone theorises: how many results there were before the restart, and how many after.

What you'll learn

  • Docker skills: container-local versus persistent storage, named volumes and mounts, restart versus replacement, user-defined networks and service discovery by name, why localhost inside a container is the container, publishing ports, environment configuration and secrets at run time, and proving restart behaviour with evidence.

Who you work with

  • Kabelo Mokoena

    Platform and DevOps Engineer

  • Amara Okafor

    ML and Data Engineer

Scenes

  1. 1.Before and after
  2. 2.Where does each thing live?
  3. 3.Tell the container everything
  4. 4.Read two symptoms from fresh logs
  5. 5.Prove it survives a replacement
  6. 6.Storage and networking check

What you leave with

The two symptoms had two causes. The empty results page was the old container's writable layer being deleted by a replacement, because no volume was mounted. The database error was `localhost` being the container itself, with nothing telling the service to look for `db` on a network they share. The service now gets its key and database host through the environment, finds `db` by name on `codenexus-net`, publishes 8080 to its port 8000, and keeps its results on a named volume. The proof is the sequence — a kept failure, a fixed run that writes a result, and a replacement that reports resuming with it — and the volume is understood as persistence across containers, not as a backup.

Previous episode

It Works on My Laptop

Next episode

The Secret in the Image

Code Nexus

Practice first. Improvise less later.

We post practical tech tips and the odd 8-BIT opinion. Mostly the tips.

The CPD Group Approved Provider #791172

Learn

  • Curriculum
  • Pricing
  • Create account
  • Sign in

Support

  • Blog
  • Certification guides
  • About Code Nexus
  • How we teach
  • Human help

Legal

  • Terms and Conditions
  • Privacy Policy
  • Cookie Policy
  • Refund and Cancellation
  • Contact: contact@codenexus.co.za

© 2026 Code Nexus. All rights reserved.

Payments secured by Payfast · Billed in ZAR · South Africa