This guide explains how to deploy the EngiAI chatbot using Docker on Windows Server or any other platform.
- Docker installed on your system
- Docker Compose (optional, but recommended)
- API keys for OpenAI and Tavily and Google
The following services must be cloned locally and accessible to the Docker containers:
-
MMORE RAG Service - Multimodal document retrieval system
# Contact the MMORE team or check internal documentation for repository access git clone <mmore-repository-url> cd mmore # Follow MMORE setup instructions
- Default URL:
http://localhost:8000 - Configure with
MMORE_RAG_URLin.env
- Default URL:
-
Prusa Connect MCP Server (Optional - only if using 3D printer integration)
- Installed as a pip dependency from git
(
prusa-mcp @ git+https://github.com/gioelemo/prusa-mcp.git), declared inservices/prusa_mcp_server/requirements-mcp.txt - Built automatically into the
prusa-mcp-serverDocker image byservices/prusa_mcp_server/Dockerfile - See
services/prusa_mcp_server/README.mdfor configuration - Set
SKIP_MCP=falseto enable
- Installed as a pip dependency from git
(
These services run as separate containers/processes and the EngiAI connects to them via network.
-
Create a
.envfile from the example:cp .env.example .env
-
Edit the
.envfile and add your API keys:OPENAI_API_KEY=your_actual_openai_key TAVILY_API_KEY=your_actual_tavily_key
-
Build and run with Docker Compose:
docker-compose up -d
-
Access the application: Open your browser and navigate to
http://localhost:8501 -
View logs:
docker-compose logs -f chatbot
-
Stop the application:
docker-compose down
-
Build the Docker image:
docker build -t engiai-chatbot . -
Run the container with environment variables:
docker run -d \ --name engiai \ -p 8501:8501 \ -e OPENAI_API_KEY=your_openai_key \ -e TAVILY_API_KEY=your_tavily_key \ -v $(pwd)/data:/app/data \ engiai-chatbot -
Access the application: Open your browser and navigate to
http://localhost:8501
- Install Docker Desktop for Windows or Docker Engine
- Clone your repository or copy the project files to the server
- Follow the "Quick Start" instructions above
If you build the image on your local machine and want to deploy on Windows Server:
-
On your build machine (Mac/Linux):
# Build the image docker build -t engiai-chatbot . # Save the image to a tar file docker save -o engiai-chatbot.tar engiai-chatbot
-
Transfer the tar file to Windows Server (via SCP, FTP, USB, etc.)
-
On Windows Server:
# Load the image docker load -i engiai-chatbot.tar # Create a .env file with your API keys # Then run with Docker Compose or Docker CLI docker run -d ` --name engiai ` -p 8501:8501 ` --env-file .env ` -v ${PWD}/data:/app/data ` engiai-chatbot
-
Push to Docker Hub (or another registry):
# Tag the image docker tag engiai-chatbot your-username/engiai-chatbot:latest # Login to Docker Hub docker login # Push the image docker push your-username/engiai-chatbot:latest
-
On Windows Server, pull and run:
docker pull your-username/engiai-chatbot:latest docker run -d ` --name engiai ` -p 8501:8501 ` --env-file .env ` -v ${PWD}/data:/app/data ` your-username/engiai-chatbot:latest
OPENAI_API_KEY: Your OpenAI API keyGOOGLE_API_KEY: Your Google API keyTAVILY_API_KEY: Your Tavily API key
SKIP_MCP: Skip Prusa MCP server initialization (default:falsein Docker)- Set to
trueto disable 3D printer integration - Set to
false(default in docker-compose) to enable Prusa MCP
- Set to
LLM_MODEL: Model to use (default:openai:gpt-4.1)DATABASE_URL: Database connection string (default:sqlite:///data/conversations.db)LANGCHAIN_TRACING: Enable LangSmith tracing (default:false)
See .env.example in the project root for all available configuration options.
The application includes optional integration with Prusa Connect via an MCP (Model Context Protocol) server for 3D printer management. For most deployments, this is not needed and should be disabled by setting SKIP_MCP=true.
To enable Prusa integration (advanced):
- Set up the Prusa MCP server at the path specified in
PRUSA_MCP_PATH - Set
SKIP_MCP=falsein your.envfile - Configure
PRUSA_MCP_PATHenvironment variable in your.envfile
For basic chatbot functionality, keep SKIP_MCP=true (the default).
The Docker configuration automatically mounts your SSH configuration from ~/.ssh into the container. This enables:
- Connection to HPC clusters (like ETH's Euler cluster)
- SLURM job submission and monitoring
- Remote file operations
How it works:
- Your
~/.sshdirectory is mounted read-only to/root/.ssh-hostin the container - The
docker-entrypoint.shscript copies the SSH configuration and sets proper permissions (600 for keys, 644 for known_hosts) - SSH client is pre-installed in the container
What you need:
- Your
~/.ssh/configfile with host aliases (e.g., "euler") - SSH private keys in
~/.ssh/ - The remote host's entry in
~/.ssh/known_hosts(add it by connecting once from your host machine)
For passphrase-protected SSH keys: If your SSH key is protected with a passphrase, you need to use SSH agent forwarding:
-
Start SSH agent and add your key (on your host machine):
# Start the SSH agent eval "$(ssh-agent -s)" # Add your SSH key (you'll be prompted for the passphrase once) ssh-add ~/.ssh/id_rsa # or id_ed25519, or whatever your key is named # Verify the key is loaded ssh-add -l
-
Start the container (the SSH agent socket is automatically mounted):
docker-compose up -d
-
The container will use your host's SSH agent - no passphrase required!
Alternative: Use an unencrypted key (less secure): If you prefer not to use SSH agent, you can create a separate SSH key without a passphrase specifically for the container:
ssh-keygen -t ed25519 -f ~/.ssh/id_docker_euler -N ""
# Then add this key to your Euler account's authorized_keysTesting SSH connection: Once the container is running, you can test the SSH connection through the chatbot UI by asking it to connect to the HPC cluster.
Security notes:
- SSH keys are mounted read-only from your host
- Keys are copied into the container (not shared directly)
- Container is isolated from your host system
- For production, consider using SSH agent forwarding or secrets management
The application stores conversation data in the /app/data directory. To persist this data:
-
Using Docker Compose: The
docker-compose.ymlalready mounts./data:/app/data -
Using Docker CLI: Add the volume mount:
-v $(pwd)/data:/app/data
Error: ValueError in config validation
Solution: Ensure OPENAI_API_KEY and TAVILY_API_KEY are set in your .env file or passed as environment variables.
Solution: Either stop the service using port 8501 or map to a different port:
docker run -p 8080:8501 ... # Access on http://localhost:8080Solution: If using PostgreSQL, ensure the database is accessible from the container. For SQLite (default), ensure the data directory is mounted.
# Using Docker Compose
docker-compose logs -f chatbot
# Using Docker CLI
docker logs -f engiai# Using Docker Compose
docker-compose restart
# Using Docker CLI
docker restart engiaiThe application includes a health check endpoint. You can verify the application is running:
curl http://localhost:8501/_stcore/health- Pull latest code from your repository
- Rebuild the image:
docker-compose build
- Restart the container:
docker-compose up -d
- Never commit
.envfiles with real API keys to version control - Use secrets management in production (Docker secrets, Kubernetes secrets, etc.)
- Restrict network access to the container if needed
- Regularly update the base image and dependencies
For production deployments, consider:
- Using orchestration platforms (Docker Swarm, Kubernetes)
- Implementing load balancing
- Setting up automated backups for the data directory
- Using managed databases instead of SQLite
- Implementing monitoring and alerting
Add resource limits to prevent excessive resource usage:
# In docker-compose.yml
services:
chatbot:
# ... other configuration ...
deploy:
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2GFor running agent evaluations with MMORE RAG enabled, a separate Docker Compose file is provided that runs on a different port to avoid conflicts with the main application.
- Port isolation: Eval service runs on port 8001, main service on port 8000
- Independent volumes: Separate cache and upload volumes prevent data conflicts
- Parallel execution: Run evaluations while the main application is running
# Start MMORE for evaluations (port 8001)
make mmore-eval-up
# Check status
make mmore-eval-status
# View logs
make mmore-eval-logs
# Stop when done
make mmore-eval-down# Use the dedicated make command
make mmore-eval-run ARGS="--problem beams2d --samples 5 --scorers all --seed 1"
# Or set the environment variable manually
MMORE_RAG_URL=http://localhost:8001 python benchmarks/evaluations/evaluate_agent.py \
--problem beams2d --samples 5 --mmore| Service | Compose File | Container | Host Port |
|---|---|---|---|
| Main MMORE | docker-compose.yml |
mmore-rag-service |
8000 |
| Eval MMORE | docker-compose.mmore-eval.yml |
mmore-rag-eval |
8001 |
See benchmarks/evaluations/README.md for detailed evaluation documentation.
For issues and questions:
- Check the main README.md in the project root
- Review the Database Setup Guide for database configuration
- Check Docker logs for error messages