Docker Setup & Infrastructure
The MOOD MNKY ecosystem uses Docker and Docker Compose for containerized services and development environments. This guide covers setting up, managing, and deploying containerized services.Overview
Docker is used for:- Development Services: Local development environments (n8n, Supabase)
- Service Templates: Standardized Docker Compose configurations
- Application Containers: Containerized applications (MNKY Agents Demo)
Docker Compose Templates
Standardized Docker Compose templates are located ininfra/docker-compose/:
Available Templates
n8n Development
Workflow automation with AI integration
MNKY Agents Demo
Python FastAPI demo application
n8n Development Instance
Quick Start
-
Navigate to template directory:
-
Copy environment template:
-
Configure environment variables:
Edit
.envwith your values: -
Start the service:
- Access n8n: http://localhost:5678
Features
- AI Integration: OpenAI integration for AI capabilities
- SMTP Configuration: Email actions via SMTP
- Data Persistence: Named volumes for workflow storage
- Basic Authentication: Secure access control
- Development Settings: Optimized for local development
Management Commands
MNKY Agents Demo Container
The MNKY Agents Demo application includes Docker support:Setup
-
Navigate to application:
-
Build and run:
- Access API: http://localhost:8000
- API Docs: http://localhost:8000/docs
Dockerfile Configuration
The application uses a multi-stage build:- Build stage: Installs dependencies and builds application
- Runtime stage: Minimal image with only runtime dependencies
Best Practices
Security
- Change Default Credentials: Always change default usernames/passwords
- Use Environment Variables: Never hardcode secrets in Docker Compose files
- Network Isolation: Use Docker networks to isolate services
- Volume Permissions: Set appropriate volume permissions
Data Persistence
- Named Volumes: Use named volumes for data persistence
- Backup Strategy: Regularly backup volume data
- Volume Management: Clean up unused volumes periodically
Resource Management
- Resource Limits: Set CPU and memory limits for containers
- Health Checks: Configure health checks for services
- Restart Policies: Use appropriate restart policies (
unless-stopped)
Adding New Templates
When creating a new Docker Compose template:-
Create directory structure:
-
Follow template structure:
- Use environment variables for configuration
- Include proper container naming
- Document all configuration options
- Provide example environment file
-
Update main README: Add new template to
infra/docker-compose/README.md
Troubleshooting
Common Issues
Port Conflicts
- Issue: Port already in use
- Solution: Change port mapping in
docker-compose.ymlor stop conflicting service
Volume Permissions
- Issue: Permission denied errors accessing volumes
- Solution: Check volume ownership and permissions. Use
docker-compose down -vto remove volumes if needed.
Container Won’t Start
- Issue: Container exits immediately
- Solution: Check logs with
docker-compose logs. Verify environment variables and configuration.
Debugging
Related Resources
- n8n Workflows - Workflow management guide
- MNKY Agents Demo - Demo application documentation
- Supabase Local Development - Local Supabase setup
- Environment Setup - Development environment guide