Docker Desktop is a local desktop application for building, running, and managing containerized agent services. It provides a practical bridge between an application folder and a running container. section 8.2.1 section 8.2
A Dockerfile defines the container setup; Docker builds an image from it, while Docker Desktop helps operate the resulting containers. Local Docker Desktop use contrasts with larger deployments using Kubernetes or cloud platforms. section 8.2.1 section 8.2
A practical Docker Desktop workflow is:
- Place the generated Dockerfile beside the application. section 8.2.1
- Build an image with docker build, then run it with a port mapping and required API key. section 8.2.1
- Assign a container name when you want to start, stop, inspect, and manage it from Docker Desktop. section 8.2.1
- Use Docker Compose when the web UI, voice agent, and image agent must run as one stack. section 8.5
Run an image-generation API
Build image-generator:latest from the application directory, then run it on local port 8000 with OPENAI_API_KEY supplied as an environment variable. Rerun it as image-gen when you want to manage the container through Docker Desktop and observe its logs. section 8.2.1 section 8.5
Listing 8.4 Dockerfile and generation prompt
{copy the Python web API or MCP code above}
Prompt: Generate a Dockerfile that containerizes the above application. The above application is called 02_app.py. #1
FROM python:3.11-slim #2
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=8000
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential curl ca-certificates && \
rm -rf /var/lib/apt/lists/* #3
COPY requirements.txt /app/requirements.txt #4
RUN if [ -f /app/requirements.txt ]; then \
pip install --no-cache-dir -r /app/requirements.txt; \
else \
pip install --no-cache-dir "uvicorn[standard]" fastapi; \
fi
COPY . /app
EXPOSE ${PORT} #5
CMD ["sh", "-c", "uvicorn 02_app:app --host 0.0.0.0 --port ${PORT}"]
Inspect the Dockerfile-generation prompt and the resulting Python 3.11 container definition, including dependencies, port exposure, and the Uvicorn command. section 8.2.1


