Skip to content

Deployment & Server Management

Prerequisites

SoftwareMinimum Version
Docker24.0+
Docker Compose2.20+
Node.js20+
pnpm9+
Git2.30+

Initial Installation

Step 1: Clone Repository

bash
git clone <repository-url> hereby-dhub
cd hereby-dhub

Step 2: Configure Environment

bash
cp .env.example .env

Edit .env with your environment settings:

bash
# Database (MUST change)
DB_PASSWORD=your-secure-password-here

# JWT (MUST change)
JWT_SECRET=your-jwt-secret-key

# API
API_PORT=3000

# Timezone
TZ=Asia/Seoul

Security Warning

Always change DB_PASSWORD and JWT_SECRET in .env. Never use default values in production.

Step 3: Full Setup

bash
make setup

This command sequentially:

  1. Installs dependencies (pnpm install)
  2. Starts Docker containers (PostgreSQL, Redis, pgAdmin)
  3. Runs database migrations
  4. Seeds initial data

Step 4: Start Services

bash
make dev

Service Updates

Code Update

bash
# 1. Pull latest code
git pull origin main

# 2. Update dependencies
pnpm install

# 3. Build
pnpm build

# 4. Run migrations (if needed)
make db-migrate

# 5. Restart services
make dev

Docker Container Management

bash
# Check container status
docker-compose ps

# Start / Stop / Restart
make db-start
make db-stop
make db-restart

# View logs
make db-logs
docker-compose logs -f postgres
docker-compose logs -f redis

Documentation Site Deployment

Deploy Docs via Docker

bash
# Build and run docs Docker container
make docs-docker

This builds the VitePress docs site and serves it via nginx at http://localhost:4001.

Versioned Build

bash
# Multi-version build (tag-based)
bash scripts/docs-build.sh

Production Deployment Checklist

  • [ ] Changed .env secret values
  • [ ] Set NODE_ENV=production
  • [ ] Configured SSL/TLS certificates
  • [ ] Set firewall rules (open only required ports)
  • [ ] Configured database backup schedule
  • [ ] Set up log rotation
  • [ ] Connected monitoring tools