OpsMind ships as a fully containerised application. A singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/LENINMORENO13/OpsMind/llms.txt
Use this file to discover all available pages before exploring further.
docker-compose.yml spins up both the Postgres database and the API server with one command, making local development and staging environments easy to reproduce. For production, the same Dockerfile is used by the live instance hosted on Render, and it can be deployed to any Docker-compatible platform with minimal configuration.
Local deployment with Docker Compose
Thedocker-compose.yml file defines two services that work together:
db— apostgres:15-alpinecontainer that runs on host port5433(mapped from container port5432). The database name, user, and password are set viaPOSTGRES_*environment variables. A named volume (db_data) is mounted at/var/lib/postgresql/datato persist data across container restarts.api— the OpsMind API built from the local Dockerfile, exposed on port3000:3000. It depends ondband connects to it over the Docker bridge network using the service hostnamedb.
Start all services
Stop all services
Remove containers and volumes
docker-compose.yml
What the Dockerfile does
The Dockerfile builds a lean, single-stage image on top ofnode:20-alpine.
Dockerfile
Base image
node:20-alpine provides a minimal Node.js 20 environment. The Alpine base keeps the final image small.Install dependencies
package*.json is copied first — before the rest of the source — so that Docker’s layer cache is reused on subsequent builds when only application code changes.Generate the Prisma client
npx prisma generate is run while only the prisma/ directory is in scope, again to maximise cache efficiency. This compiles the type-safe Prisma client from schema.prisma.Copy source and expose the port
The remainder of the application is copied and port
3000 is declared.Database migrations
prisma db push (run automatically on startup) introspects prisma/schema.prisma and applies any missing tables or columns directly to the target database without generating a migration file. This is convenient for development and the current production deployment, but it is not recommended for teams that need a versioned migration history.
For production environments that require auditable, reversible migrations:
Environment variables
OpsMind requires three environment variables at runtime. See the configuration reference for full details.| Variable | Required | Description |
|---|---|---|
DATABASE_URL | ✅ | PostgreSQL connection string in Prisma URL format |
JWT_SECRET | ✅ | Secret used to sign and verify JWT tokens |
GEMINI_API_KEY | ✅ | Google Gemini API key for AI incident analysis |
.env file for local development without Docker looks like this:
.env
docker-compose.yml, the GEMINI_API_KEY is forwarded from the host environment using "${GEMINI_API_KEY}". Set it in your shell before running docker compose up:
Terminal
Production deployment
The live OpsMind API is hosted athttps://opsmind-e07b.onrender.com on Render. Render detects the Dockerfile at the repository root and builds the image on every push to main. Environment variables (DATABASE_URL, JWT_SECRET, GEMINI_API_KEY) are configured in the Render dashboard under the service’s Environment tab.
To deploy OpsMind to any Docker-compatible platform:
Provision a PostgreSQL database
Any managed Postgres service works. Construct a
DATABASE_URL connection string in the format postgresql://USER:PASSWORD@HOST:PORT/DB?schema=public.Set environment variables on the platform
Configure
DATABASE_URL, JWT_SECRET, and GEMINI_API_KEY as secrets or environment variables on your platform (Fly.io, Railway, AWS ECS, Kubernetes Secret, etc.).CI pipeline
The GitHub Actions workflow at.github/workflows/ci.yml runs automatically on every push or pull request targeting the main or develop branches.
.github/workflows/ci.yml (key steps)
Spin up a Postgres 15 service container
GitHub Actions starts a
postgres:15 service with test_user / test_password / monitor_test_db. A health check using pg_isready ensures the database is accepting connections before any other steps run.Install dependencies
npm ci installs a clean, reproducible set of dependencies from package-lock.json.Generate Prisma client
npx prisma generate compiles the Prisma client from the schema so that the test suite can import it.Push schema to the test database
npx prisma db push creates all tables in the ephemeral Postgres container, giving Jest a fully-provisioned database to run against.Running tests
Run the full test suite locally with:Terminal
--detectOpenHandles to catch any async resources (database connections, cron timers) that are not properly cleaned up after tests.
Generate a coverage report with:
Terminal