The StrellerMinds-Backend is designed to be deployed as a containerized application, supporting both local development and production-grade environments.
We use Docker and Docker Compose to manage the lifecycle of the application and its dependencies.
| Environment | Configuration | Purpose |
|---|---|---|
| Development | docker-compose.dev.yml |
Local feature development, debugging with Jaeger. |
| Testing | CI Pipeline | Automated Jest (Unit/Integration) and Cypress (E2E) tests. |
| Production | docker-compose.prod.yml |
Hardened production environment with observability. |
- Role: Core logic, API endpoints, background jobs.
- Port: 3000
- Health Check:
/api/health - Configuration: Managed via
.envfiles (S3, Stripe, DB credentials).
The production environment (docker-compose.prod.yml) includes a complete observability suite:
- Jaeger: Distributed tracing for identifying performance bottlenecks across modules.
- Prometheus: Metrics collection (CPU, Memory, Request Rate).
- Grafana: Dashboarding for visualizing Prometheus and Jaeger data.
- PostgreSQL: Relational data storage.
- Redis: High-speed caching and rate-limiting storage.
- Elasticsearch: Full-text search index (managed externally or via separate cluster).
The production Docker configuration follows security best practices:
- User Permission: Runs with
no-new-privileges:true. - Read-Only FS: The application root is
read_only: truewith specifictmpfsmounts for temporary operations. - Resource Limits: 1GB Memory limit and 1.0 CPU limit per instance to prevent noisy neighbor issues.
- Ensure the
.env.productionfile is populated. - Build and start the cluster:
docker-compose -f docker-compose.prod.yml up -d --build
- Verify health via Grafana at port 3001 or directly via the
/api/healthendpoint.