Why I Built a Docker Framework for Dermatology AI
The Moment Everything Changed
It was a Tuesday afternoon in the Mohs surgery suite. I had just finished excising a recurrent basal cell carcinoma on a patient's nose, and I wanted to cross-reference the histology with a dermoscopic pattern database. The fastest option was a cloud-based AI service. I uploaded the dermoscopy image, waited for the result, and then realized what I had done: I had just sent a patient's clinical image -- with identifiable features -- to a server I did not control, in a jurisdiction I could not verify, processed by a model whose data retention policy I had never read.
The Problem with Cloud AI in Clinical Settings
That moment forced me to think carefully about the tools I was using. Cloud AI services are convenient, but they create a fundamental tension with clinical practice. Patient data leaves the clinic network. You depend on an internet connection that may not always be available mid-surgery. The model can change without notice -- an update pushed overnight could alter diagnostic outputs. And the cost scales with every image you upload, every query you run. For a single practitioner running a Mohs surgery practice, these are not abstract concerns. They are daily operational risks.
Docker as the Answer
I had been using Docker in small ways for years -- running development databases, testing web applications. But it took that clinical moment for me to see Docker as a medical device deployment strategy. The core insight is simple: a Docker container bundles the model, its dependencies, and its runtime environment into a single portable artifact. You pull it once, run it locally, and the data never leaves your machine. No internet required. No API keys. No per-query billing. The model version is pinned, so you know exactly what you are running today and tomorrow.
Building the First Tool
The first Docker-based tool I built was a dermoscopy classifier. It was rough -- a PyTorch model wrapped in a Flask API, packaged in a container. The interface was a simple HTML form. But it worked. I could drag a dermoscopic image onto the page, get a classification result in under two seconds, and know with certainty that the image had never left my clinic's local network. That prototype became the seed for what would grow into MohsPedia's AI-assisted features.
From One Tool to Five
Over the following year, the framework expanded. DermTools evolved from a standalone template app into a comprehensive clinical platform, then moved to a Docker-deployable service. PathCorrelate's OCR pipeline became containerized. MohsBoard's real-time dashboard was built with Docker Compose from the start. Each new tool followed the same pattern: build locally, test locally, deploy locally. The Docker framework became a philosophy as much as a technology choice -- physician-controlled AI means the physician controls the infrastructure.
What I Learned Along the Way
Building a Docker framework for clinical AI taught me three things that no conference talk or journal article had prepared me for. First, simplicity wins. If a surgeon cannot start the tool with a single command, the tool will not be used. Second, privacy is not a feature -- it is a prerequisite. Every architectural decision must assume the data is sensitive. Third, physicians can and should build their own tools. The gap between clinical need and available software is enormous, and Docker makes it possible for a single developer to bridge that gap for their own practice.
The Current State
Today, the DermUnbound Docker framework runs five clinical AI tools on commodity hardware. A Mac Mini under my desk powers dermoscopy classification, pathology report processing, surgical documentation, and decision support -- all without sending a single byte of patient data to the cloud. The total infrastructure cost after initial hardware purchase is zero. That is the power of physician-controlled AI: once you own the tools, you own the workflow.
Related Project
MohsPediaClinical decision support for Mohs micrographic surgery — 7 interactive tools