Running in Production with Node.js
Before deploying, make sure you have Node.js 20+ installed and a valid TMDB API key.1. Configure your environment
Copy the example environment file and fill in all required values:.env should look like this:
.env
Setting
NODE_ENV=production disables debug logging and enables production-grade error handling. Setting CACHE_TYPE=redis is strongly recommended in production — in-memory cache is not shared across processes and is lost on restart.2. Build and start
The
npm start script in package.json runs npm run build && node dist/server.js, so it rebuilds on every start. For production, prefer pre-building once and running node dist/server.js directly to avoid unnecessary rebuild overhead.3. Logging
WhenNODE_ENV=production, the server keeps the console clean — verbose debug output is suppressed. The OMSS framework logs startup info (host, port, registered providers) and critical errors. Standard output streams (stdout / stderr) are suitable for capture by any log aggregator such as pm2 logs, journald, or a cloud logging sink.
For persistence and rotation, pipe output to a process manager or system service:
4. Redis
In production, CinePro Core uses Redis to cache scraped sources (TTL: 1 hour) and subtitles (TTL: 24 hours). Run Redis locally or pointREDIS_HOST to a remote instance. A minimal Redis setup:
Docker Compose (with Redis)
The includedcompose.yml starts both CinePro Core and a Redis instance on a shared internal network. This is the recommended way to run locally or on a home server.
Required .env fields
The Compose file reads TMDB_API_KEY from your shell environment or a .env file in the same directory:
.env
compose.yml with sensible defaults:
| Variable | Value in compose.yml | Notes |
|---|---|---|
HOST | 0.0.0.0 | Binds to all interfaces inside the container |
PORT | 3000 | Also the exposed host port |
NODE_ENV | production | Disables debug logging |
TMDB_CACHE_TTL | 86400 | 24 h metadata cache |
CACHE_TYPE | redis | Uses the bundled Redis service |
REDIS_HOST | redis | Internal Docker network hostname |
REDIS_PORT | 6379 | Standard Redis port |
Starting the stack
http://localhost:3000.
Exposed ports
| Service | Container port | Host port | Description |
|---|---|---|---|
cinepro-core | 3000 | 3000 | HTTP API |
redis | 6379 | 6379 | Redis (internal use) |
Restarting and scaling
restart: unless-stopped, so they automatically restart after a host reboot or container crash without any extra tooling.
Standalone Docker Image
Use this approach if you want to manage the container lifecycle yourself or integrate CinePro Core into an existing container platform (Portainer, Unraid, Synology, etc.).Build the image
Example: in-memory cache (quick test)
In-memory cache is lost every time the container restarts. Use Redis for anything beyond local testing.
Example: with external Redis
Example: custom port
The
PORT env var must match the container-side port in -p HOST_PORT:CONTAINER_PORT. Both sides must be the same unless you intentionally remap them.Reverse Proxy & TLS
CinePro Core speaks plain HTTP. For production, you should put it behind a reverse proxy that terminates TLS, handles certificates, and optionally adds rate limiting or authentication.NGINX (minimal config sketch)
Caddy (automatic TLS)
Caddy automatically provisions and renews TLS certificates from Let’s Encrypt — no manual certificate management needed.Caddyfile
caddy run and Caddy handles HTTPS automatically.