IONOS Agent Docs v1.0 just launched!⭐ Star us on GitHub
docsDocker

Local Testing with Docker

In this part, we will explain how to run the backend (FastAPI) and Streamlit chat UI together using Docker Compose for quick local testing.

Prerequisites

  • Install Docker (Docker Desktop for Windows/macOS, or Docker Engine for Linux).
  • (Optional) Create a .env file at the project root so environment variables are auto-loaded:
IONOS_API_KEY=your_ionos_key_here
TAVILY_API_KEY=your_tavily_key_here

On PowerShell you can also export them temporarily:

$env:IONOS_API_KEY = "your_ionos_key_here"
$env:TAVILY_API_KEY = "your_tavily_key_here"

Start Services

From the repository root (IONOS-simple-chatbot/):

docker compose up --build

What happens:

Verify

Stopping & Cleanup

Press Ctrl+C to stop. To also remove containers, network, and anonymous volumes:

docker compose down -v

Rebuild After Changes

If Python dependencies changed (e.g., edited requirements.txt):

docker compose build --no-cache backend-service
 docker compose up

Only code changes? Usually docker compose up --build is enough.

Troubleshooting

IssueCauseFix
Port already in useAnother process on 8000/8501Edit ports: mapping in compose file
401 / tool errorsMissing API keysEnsure env vars set (docker exec -it <container> env)
Changes not visibleCached image layerUse --build or build --no-cache
Slow first startDependency installSubsequent runs are faster due to layer caching