# Docker Files Summary
This document summarizes all Docker-related files in the Weather MCP project.
## π³ Core Docker Files
### `Dockerfile`
- **Purpose**: Production container image for Weather MCP server
- **Features**: Multi-stage build, security hardening, non-root user
- **Base**: Python 3.13-slim
- **Command**: `python main.py server --host 0.0.0.0 --port 8000`
### `docker-compose.yml`
- **Purpose**: Main orchestration file for all services
- **Services**:
- `ollama`: Ollama LLM server (port 11434)
- `ollama-setup`: One-time model downloader
- `weather-server`: Weather MCP API (port 8000)
- `weather-demo`: Demo client (profile: demo)
- **Networks**: `weather-mcp-network`
- **Volumes**: `ollama_data` for model persistence
### `docker-compose.prod.yml`
- **Purpose**: Production overrides
- **Features**: Resource limits, security settings, health checks
- **Usage**: `docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d`
### `docker-compose.dev.yml`
- **Purpose**: Development overrides
- **Features**: Live reload, debug logging, relaxed security
- **Usage**: `docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d`
## π Configuration Files
### `.env`
- **Purpose**: Docker environment variables
- **Settings**: Server config, Ollama integration, security settings
- **Note**: Pre-configured for Docker networking (`OLLAMA_HOST=http://ollama:11434`)
### `.env.production`
- **Purpose**: Production environment template
- **Usage**: Copy from `.env.example` and customize for production
### `.dockerignore`
- **Purpose**: Exclude files from Docker build context
- **Excludes**: `__pycache__`, `.git`, development files, logs
## π Management Scripts
### `start-docker.sh`
- **Purpose**: Comprehensive startup script with options
- **Features**: Environment selection, demo mode, verbose logging
- **Usage**: `./start-docker.sh [--prod|--dev] [--demo] [--verbose] [--build]`
### `stop-docker.sh`
- **Purpose**: Clean shutdown with cleanup options
- **Features**: Graceful stop, cleanup modes, data preservation
- **Usage**: `./stop-docker.sh [--cleanup] [--remove-data]`
### `validate-docker.sh`
- **Purpose**: Environment validation and setup
- **Features**: Docker version check, memory validation, compose wrapper
- **Usage**: `./validate-docker.sh`
## π§ Generated Files
### `docker-compose-wrapper.sh`
- **Purpose**: Auto-generated by `validate-docker.sh`
- **Function**: Abstracts docker-compose vs docker compose v2 differences
- **Note**: Automatically created during validation
## π Directory Structure for Docker
```
weather/
βββ docker-compose.yml # Main orchestration
βββ docker-compose.prod.yml # Production overrides
βββ docker-compose.dev.yml # Development overrides
βββ Dockerfile # Container image definition
βββ .dockerignore # Build exclusions
βββ .env # Docker environment config
βββ .env.production # Production template
βββ start-docker.sh # Startup script
βββ stop-docker.sh # Shutdown script
βββ validate-docker.sh # Environment validation
βββ requirements.txt # Python dependencies
βββ [application files]
```
## π Network Architecture
```
Host System (localhost)
βββ 8000 β weather-server:8000 (Weather API)
βββ 11434 β ollama:11434 (Ollama API)
βββ Docker Network: weather-mcp-network
βββ weather-server (internal communication)
βββ ollama (internal communication)
βββ ollama-setup (model downloader)
βββ weather-demo (optional)
```
## π‘ Quick Reference
```bash
# Complete setup from scratch
git clone <repo> && cd weather-mcp-agent
chmod +x *.sh
./validate-docker.sh
./start-docker.sh --verbose
# Development workflow
./start-docker.sh --dev --demo
# Make changes to code...
./start-docker.sh --dev --build # Rebuild after changes
# Production deployment
./start-docker.sh --prod
curl http://localhost:8000/health
# Cleanup
./stop-docker.sh --cleanup
```