# Masoi Devops

> Manage Ma Sói Docker configuration, deployment, infrastructure, environment variables, Nginx reverse proxy, health checks, and CI/CD. Use when modifying docker-compose files, Dockerfiles, nginx.conf, .env files, or preparing for VPS/cloud deployment.

- Skill: `nobodyonlyc/masoi-devops` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add nobodyonlyc/masoi-devops`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nobodyonlyc/masoi-devops/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: nobodyonlyc (https://skillmd.com/u/nobodyonlyc)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/nobodyonlyc/masoi-devops

---


# Ma Sói DevOps

## Workflow

1. Read Docker configs: `docker-compose.yml` (production), `docker-compose.dev.yml` (dev).
2. Read Dockerfiles: `server/Dockerfile`, `client/Dockerfile`.
3. Read Nginx config: `client/nginx.conf`.
4. Read environment: `.env` (root), `server/.env`, `client/.env`.
5. Check changes against `references/deploy-checklist.md`.
6. After edits, verify:
   - `docker compose config` (validate compose syntax)
   - `docker compose -f docker-compose.dev.yml up -d` (dev infra)
   - `docker compose up --build -d` (full stack build)

## Infrastructure Rules

- Dev mode uses `docker-compose.dev.yml` for PostgreSQL + Redis only; server and client run natively with hot reload.
- Production uses `docker-compose.yml` for full stack: postgres + redis + server + client/nginx.
- Client Dockerfile uses multi-stage build: `npm run build` → Nginx serve static.
- Server Dockerfile installs production deps only.
- PostgreSQL schema auto-creates from `server/db/init.sql` on first run via Docker volume.

## Environment Management

- Root `.env` sets `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`.
- Server reads `DATABASE_URL`, `REDIS_URL`, `PORT` from env or uses defaults.
- Client reads `VITE_SERVER_URL` for Socket.IO connection (defaults to `window.location.hostname`).
- Never commit `.env` files with production credentials.

## Health & Monitoring

- `/health` endpoint exists but only returns `{ ok: true }` — does not verify backend connectivity.
- `server/check-services.js` tests PostgreSQL and Redis connections at startup.
- Consider adding readiness and liveness probes for container orchestration.

## Nginx Configuration

- Client nginx serves SPA with `try_files $uri $uri/ /index.html`.
- API proxy passes `/api/` and `/socket.io/` to server container.
- WebSocket upgrade headers must be set for Socket.IO.

## References

Load `references/deploy-checklist.md` when deploying or modifying infrastructure.

