Deployment & Server Management
Prerequisites
| Software | Minimum Version |
|---|---|
| Docker | 24.0+ |
| Docker Compose | 2.20+ |
| Node.js | 20+ |
| pnpm | 9+ |
| Git | 2.30+ |
Initial Installation
Step 1: Clone Repository
bash
git clone <repository-url> hereby-dhub
cd hereby-dhubStep 2: Configure Environment
bash
cp .env.example .envEdit .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/SeoulSecurity Warning
Always change DB_PASSWORD and JWT_SECRET in .env. Never use default values in production.
Step 3: Full Setup
bash
make setupThis command sequentially:
- Installs dependencies (
pnpm install) - Starts Docker containers (PostgreSQL, Redis, pgAdmin)
- Runs database migrations
- Seeds initial data
Step 4: Start Services
bash
make devService 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 devDocker 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 redisDocumentation Site Deployment
Deploy Docs via Docker
bash
# Build and run docs Docker container
make docs-dockerThis 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.shProduction Deployment Checklist
- [ ] Changed
.envsecret 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