Skip to main content

Production notes (Docker, ops)

VPS (PM2 + Nginx)

For a full Ubuntu VPS production setup using PM2 + Nginx (rate limiting, TLS, firewall), see:

System requirements

Minimum:

  • Node.js 16+
  • ~512MB RAM
  • SSD recommended

Running in production

Typical flow:

npm i -g @liorandb/db
NODE_ENV=production PORT=4000 ldb-serve

Use --root to place data on a dedicated volume/disk.

Docker example

This example assumes you are building an image from the @liorandb/db server repository output (a dist/ folder that contains server.js).

Example Dockerfile:

FROM node:20-alpine

WORKDIR /app

COPY package*.json ./
RUN npm ci --only=production

COPY dist ./dist

EXPOSE 4000
CMD ["node", "dist/server.js"]

Example docker run (mount data):

docker run -d ^
-p 4000:4000 ^
-v liorandb-data:/app/data ^
--name liorandb-server ^
liorandb-server