xiaohongshu
xiaohongshu
devops-local-dev
Manages the Bestays Docker Compose development environment including service orchestration, Makefile workflows, logs monitoring, and hot-reload development. This skill should be used when starting/stopping development services, checking logs, troubleshooting Docker issues, or managing the local d...
Full skill instructions
Manage the Bestays Docker Compose development environment with 4 core services (PostgreSQL, FastAPI, SvelteKit, Redis) using Makefile commands for orchestration, monitoring, and troubleshooting.
Use this skill when:
make dev, make up)make down, make restart)make logs, make logs-server, make logs-frontend)make shell-server, make shell-db)make reset)| Service | Container Name | Host Port | Purpose |
|---|---|---|---|
| postgres | bestays-db-dev | 5433 → 5432 | PostgreSQL 16-alpine with pgvector |
| server | bestays-server-dev | 8011 → 8011 | FastAPI backend with hot-reload |
| frontend | bestays-dev-frontend | 5183 → 5183 | SvelteKit 5 with Vite HMR |
| redis | bestays-redis-dev | 6379 → 6379 | Redis 7-alpine for caching/sessions |
| pgadmin | bestays-pgadmin-dev | 5050 → 80 | Database UI (optional, --profile tools) |
Access URLs:
make pgadmin)| Volume | Purpose | Survives make down? |
|---|---|---|
postgres_data | Database data | ✅ Yes |
redis_data | Redis persistence | ✅ Yes |
server_venv | Python virtual env | ✅ Yes |
frontend_node_modules | Node dependencies | ✅ Yes |
pgadmin_data | pgAdmin config | ✅ Yes |
Note: Use make reset to delete all volumes and start fresh.
All services communicate via bestays-network (bridge network).
postgres:5432, redis:6379)localhost:5433)Recommended (with validation):
make dev
This command:
Quick start (no validation):
make up
With pgAdmin (database UI):
make pgadmin
Follow all logs (recommended during development):
make logs
Service-specific logs:
make logs-server # Backend FastAPI logs
make logs-frontend # Frontend SvelteKit/Vite logs
make logs-db # PostgreSQL logs
Check service status:
make status # Docker Compose status
make check # Health check all services
make dev-status # Comprehensive status + validation
Backend (FastAPI):
.py file changes in apps/server/make logs-serverFrontend (SvelteKit):
.svelte, .ts, .js, .css changes in apps/frontend/make logs-frontendRestart after major changes:
make restart-server # Restart backend only
make restart-frontend # Restart frontend only
make restart # Restart all services
Backend shell (Python environment):
make shell-server
# Inside container: python, pytest, alembic commands
Frontend shell:
make shell-frontend
# Inside container: npm, node commands
Database shell (psql):
make shell-db
# PostgreSQL shell connected to bestays_dev
Preserve data (recommended):
make down # or make dev-stop
Stops containers, keeps volumes intact.
Full reset (delete all data):
make reset
Stops containers, deletes volumes, restarts fresh.
The project uses a Makefile for Docker Compose orchestration. Run make help to see all available commands.
Session Management:
make dev # Smart start with validation
make up # Start all services
make down # Stop services (preserve data)
make restart # Restart all services
make reset # Full reset (delete volumes)
Monitoring:
make logs # Follow all logs
make logs-server # Backend logs only
make logs-frontend # Frontend logs only
make status # Service status
make check # Health check
Shell Access:
make shell-server # Backend container shell
make shell-frontend # Frontend container shell
make shell-db # PostgreSQL shell
Development:
make build # Rebuild containers
make test-server # Run backend tests
make migrate # Run database migrations
Guidelines:
make dev for validated startup (runs preflight checks)make up for quick restart (no validation)make logs during active developmentmake reset only when you need a completely fresh start (deletes all data)Check if ports are already in use:
lsof -i :5433 # PostgreSQL
lsof -i :8011 # Backend
lsof -i :5183 # Frontend
lsof -i :6379 # Redis
Solution: Stop conflicting processes or change ports in docker-compose.dev.yml
Verify volume mount:
make shell-server
ls -la /app
# Should show your source code
Check logs for reload confirmation:
make logs-server
# Look for "Uvicorn running on..." and "Watching for changes..."
Check Vite startup:
make logs-frontend
# Look for "VITE ready in X ms" and HMR connection
Verify browser connection:
[vite] connected.Check database health:
make check
Verify connection string (from backend container):
make shell-server
echo $DATABASE_URL
# Should be: postgresql+asyncpg://bestays_user:bestays_password@postgres:5432/bestays_dev
Common issue: Backend tries to connect before PostgreSQL is ready
make restart-serverCheck if services are running:
make status
Verify port mappings:
docker ps --filter "name=bestays"
# Should show: 0.0.0.0:8011->8011/tcp
Test connectivity:
curl http://localhost:8011/api/health # Backend
curl http://localhost:5183 # Frontend
If nothing works, nuclear option:
make reset
This will:
Note: You will lose local database data. Consider backing up first (see devops-database skill).
Required variables (set in .env file):
# Database
POSTGRES_USER=bestays_user
POSTGRES_PASSWORD=bestays_password
POSTGRES_DB=bestays_dev
# Backend
CLERK_SECRET_KEY=sk_test_...
CLERK_WEBHOOK_SECRET=whsec_...
OPENROUTER_API_KEY=sk-or-v1-...
# Frontend
VITE_CLERK_PUBLISHABLE_KEY=pk_test_...
Location: Copy .env.example to .env and configure.
Validation: Run make dev-validate to check environment configuration.
# Terminal 1: Watch backend logs
make logs-server
# Terminal 2: Run tests on changes
make test-server
# Edit code → Tests auto-run → Check logs → Repeat
# Terminal 1: Watch frontend logs
make logs-frontend
# Terminal 2: Browser with DevTools open
# Edit .svelte files → Vite HMR → Instant browser update
# Start services
make dev
# Access interactive API docs
open http://localhost:8011/docs
# Make changes to Python code → Auto-reload → Refresh docs → Test
# Terminal 1: All logs
make logs
# Terminal 2: Available for commands
make shell-server # Backend work
make shell-frontend # Frontend work
make migrate # Database changes
docker-compose.dev.yml - Service definitionsMakefile - Command shortcuts (run make help).env - Environment variables (copy from .env.example)When implementing features, Claude Code will:
make devmake logs (or service-specific)make test-servermake restart-servermake checkmake downWhy Docker for Development?
make reset gives fresh startxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience