Docker Setup
The easiest way to run MachinaOs is with Docker Compose.Prerequisites
- Docker 20.10+
- Docker Compose 2.0+
- 2GB RAM minimum
Quick Start
- frontend - React app on port 3000
- backend - FastAPI server on port 3010
- whatsapp - Go WhatsApp service on port 9400
- redis - Cache on port 6379 (optional)
Container Overview
| Container | Image | Port | Purpose |
|---|---|---|---|
| frontend | machinaos-frontend | 3000 | React UI |
| backend | machinaos-backend | 3010 | API server |
| machinaos-whatsapp | 9400 | WhatsApp bridge | |
| redis | redis:7-alpine | 6379 | Cache (optional) |
Configuration
Environment Variables
Create a.env file in the project root:
Redis (Optional)
Redis is disabled by default for local development. To enable:Common Commands
Accessing Services
After starting, access:| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| Backend API | http://localhost:3010 |
| Health Check | http://localhost:3010/health |
| WebSocket | ws://localhost:3010/ws/status |
Health Checks
All containers include health checks:Troubleshooting
Container won't start
Container won't start
Check logs for errors:Common issues:
- Port already in use: Change port in
.env - Missing environment variables: Check
.envfile exists
Frontend can't connect to backend
Frontend can't connect to backend
- Verify both containers are running:
docker-compose ps - Check network: containers should be on same network
- Check CORS settings in backend
.env
WhatsApp service issues
WhatsApp service issues
Out of disk space
Out of disk space
Clean up Docker resources:
Resource Usage
Typical resource consumption:| Container | Memory | CPU |
|---|---|---|
| frontend | ~50 MB | Low |
| backend | ~150 MB | Medium |
| ~30 MB | Low | |
| redis | ~10 MB | Low |
Data Persistence
Data is stored in Docker volumes:| Volume | Purpose |
|---|---|
| backend-data | SQLite database, uploads |
| whatsapp-data | WhatsApp session |
| redis-data | Cache data |