Skip to content

Docker Setup

GitHub Copilot edited this page May 12, 2026 · 1 revision

Docker Setup

Quick Start

Prerequisites: Docker and Docker Compose, plus a COOKIE_SECRET for production-like environments.

# Build and start
docker compose up -d --build

# Show logs
docker compose logs -f

# Stop
docker compose down

# Stop and delete data
docker compose down -v

The app is available at http://localhost:3210.

Health check:

curl -fsS http://localhost:3210/health

Management Script

./docker.sh start
./docker.sh logs
./docker.sh stop

Direct Docker (without Compose)

docker build -t mdedit-io .

docker run -d \
  --name mdedit-io \
  -p 3210:3210 \
  -v $(pwd)/data:/app/data \
  mdedit-io

docker logs -f mdedit-io
docker stop mdedit-io && docker rm mdedit-io

Environment Variables

Variable Default Description
COOKIE_SECRET random (with warning) Session secret — set explicitly in production
NODE_ENV development Set to production for HTTPS-only cookies
PORT 3210 Server port
DATA_DIR /app/data SQLite database directory
RATE_LIMIT_MAX 100 API rate limit per minute per IP
SESSION_TTL_DAYS Retention of inactive sessions

Generate a secure secret:

openssl rand -hex 32

Data Persistence

The SQLite database is stored in ./data/ and persists across container restarts.

Nginx Reverse Proxy

server {
    listen 80;
    server_name md.example.com;

    location / {
        proxy_pass http://localhost:3210;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Updating the Image

docker compose build
docker compose up -d

See Also

Clone this wiki locally