Skip to main content

Docker Setup

This guide covers deploying Pcnaid MCP Hub using Docker, including development and production configurations.

Quick Start with Docker

Using Pre-built Image

Building from Source

Building with Extended Features

The Docker image supports an INSTALL_EXT build argument to include additional tools:
What’s included with INSTALL_EXT=true:
  • Docker Engine: Full Docker daemon with CLI for container management. The daemon auto-starts when the container runs in privileged mode.
  • Chrome + Firefox for Playwright (amd64 only): For browser automation tasks
The extended image is larger but provides additional capabilities for advanced use cases.
Docker-in-Docker Security Considerations:
  • Privileged mode (--privileged): Required for the Docker daemon to start inside the container. This gives the container elevated permissions on the host.
  • Docker socket mounting (/var/run/docker.sock): Gives the container access to the host’s Docker daemon. Both approaches should only be used in trusted environments.
  • For production, consider using Docker socket mounting instead of privileged mode for better security.

Docker Compose Setup

Basic Configuration

Create a docker-compose.yml file:

Production Configuration with Nginx

Environment Variables

Create a .env file for Docker Compose:

Development Setup

Development Docker Compose

Create docker-compose.dev.yml:

Development Dockerfile

Create Dockerfile.dev:

Running the Application

Development Mode

Production Mode

Configuration Management

MCP Settings Volume Mount

Create your mcp_settings.json:

Secrets Management

For production, use Docker secrets:

Data Persistence

Database Backups

Add backup service to your docker-compose.yml:
Create scripts/backup.sh:
Run backup:

Monitoring and Health Checks

Health Check Endpoint

Add to your application:

Docker Health Checks

Monitoring with Watchtower

Add automatic updates:

Troubleshooting

Common Issues

Container fails to start: Check logs with docker-compose logs mcphub Database connection errors: Ensure PostgreSQL is healthy and accessible Port conflicts: Check if ports 3000/5432 are already in use Volume mount issues: Verify file paths and permissions

Debug Commands

Performance Optimization

This Docker setup provides a complete containerized environment for Pcnaid MCP Hub with development and production configurations.