This document describes the Docker setup for the NEXO system, including local development with Docker Compose and production deployment with Kubernetes.
The system consists of the following services:
- Frontend: Next.js application
- Backend: (Planned) NestJS microservices
- Database: PostgreSQL
- Cache: Redis
- Authentication: Keycloak
- Monitoring: Prometheus and Grafana
- Docker and Docker Compose
- pnpm (for building the frontend)
-
Navigate to the docker directory:
cd docker -
Start the services:
docker-compose up -d
-
Access the services:
- Frontend: http://localhost:3000
- Keycloak: http://localhost:8080
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3001
-
Stop the services:
docker-compose down
For development with hot reload, uncomment the volumes and command in docker-compose.yml for the frontend service.
-
Ensure you have a Kubernetes cluster running.
-
Build and push the frontend image:
docker build -t your-registry/nexo-frontend:latest nexo-prj/apps/nexo-prj/ docker push your-registry/nexo-frontend:latest
-
Update the image in
k8s/frontend.yml. -
Run the deployment script:
./scripts/deploy.sh
-
Access the services via LoadBalancer or Ingress.
- Scale services as needed with
kubectl scale. - Use Ingress for external access.
- Configure persistent volumes for data persistence.
All images used are multi-architecture and support ARM64, making them compatible with Raspberry Pi.
- Prometheus scrapes metrics from all services.
- Grafana provides dashboards for visualization.
- Access Grafana at http://localhost:3001 (dev) or via K8s service.
- Change default passwords in production.
- Use secrets management for sensitive data.
- Configure TLS/HTTPS for production.
- Check logs:
docker-compose logsorkubectl logs. - Verify network connectivity between services.
- Ensure ports are not conflicting.