Deploy the entire Predictive Maintenance System stack (backend + frontend) using Docker containers for consistent, portable deployment across environments.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/BhaveshBytess/PREDICTIVE-MAINTENANCE/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Ensure you have installed:- Docker Engine 20.10+
- Docker Compose V2+
- Git
Quick Start
Access the application
Once started, access:
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
Docker Compose Configuration
Thedocker-compose.yml defines two main services:
Backend Service
restart: unless-stopped- Auto-restarts on failure- Health checks every 30 seconds
- Environment variables loaded from
backend/.env - Exposed on port 8000
Frontend Service
- Multi-stage build with nginx
- Depends on backend service
- Production-optimized React build
- Exposed on port 5173 (mapped to internal port 80)
Environment Configuration
Docker Commands Reference
Service Management
Monitoring and Logs
Container Management
Optional: Local InfluxDB
For complete isolation, run InfluxDB locally instead of using InfluxDB Cloud:Uncomment InfluxDB service
Edit Also uncomment the volumes section:
docker-compose.yml and uncomment the InfluxDB section:Restart services
Troubleshooting
Port Already in Use
Problem: Errorport is already allocated
Solution: Change the port mapping in docker-compose.yml:
Backend Health Check Failing
Problem: Container repeatedly restarting Solution: Check logs and verify InfluxDB connection:Build Failures
Problem:Error response from daemon: failed to build
Solution: Clear Docker cache and rebuild:
Cannot Connect to Backend from Frontend
Problem: API requests failing in browser Solution: Ensure services are on the same network. Check with:http://localhost:8000, not the container name.
Production Considerations
Security Hardening
For production-like local deployment:-
Use secrets management:
- Enable TLS: Add nginx reverse proxy with Let’s Encrypt certificates
-
Limit container resources:
-
Use specific image tags (not
latest):
Next Steps
- Learn about Local Development for manual setup
- Configure Production Deployment on cloud platforms
- Explore the API Reference for integration