Docker images for Node.js applications and services. Includes npm, common development tools, and multimedia libraries.
20/Dockerfile- Node.js 20 LTS with development tools22/Dockerfile- Node.js 22 LTS with development toolsentrypoint.sh- Container entrypoint with STARTUP variable supportREADME.md- This file
docker run -it \
-e STARTUP="npm start" \
ghcr.io/nodebytehosting/nodejs:nodejs_20version: '3.8'
services:
node-app:
image: ghcr.io/nodebytehosting/nodejs:nodejs_20
ports:
- "3000:3000/tcp"
environment:
STARTUP: "npm start"
NODE_ENV: production
volumes:
- ./app:/home/container
restart: unless-stoppeddocker build -t node:20 nodejs/20/
docker run -it -e STARTUP="npm start" node:20| Variable | Default | Description |
|---|---|---|
STARTUP |
- | Node.js command to execute (required) |
TZ |
UTC | Timezone (e.g., America/New_York) |
INTERNAL_IP |
auto | Internal container IP (auto-detected) |
NODE_ENV |
- | Set to production for production apps |
USER |
container | Container user (read-only) |
HOME |
/home/container | Container home directory (read-only) |
The entrypoint supports Pterodactyl-style variable substitution:
# Input
STARTUP="node app.js --port {{SERVER_PORT}} --bind {{INTERNAL_IP}}"
# Output
STARTUP="node app.js --port 8080 --bind 172.17.0.2"npm- Node package managercurl- HTTP/HTTPS downloadswget- Alternative downloadergit- Clone repositoriesopenssl- SSL/TLS utilitiesffmpeg- Audio/video processingsqlite- Database supporttar- Archive extractionca-certificates- Certificate authoritiestzdata- Timezone data
docker run -it \
-e STARTUP="npm start" \
-e NODE_ENV=production \
-p 3000:3000/tcp \
-v ./app:/home/container \
ghcr.io/nodebytehosting/nodejs:nodejs_20docker run -it \
-e STARTUP="npm run dev -- --port 8080" \
ghcr.io/nodebytehosting/nodejs:nodejs_20docker run -it \
-e STARTUP="node --max-old-space-size=2048 app.js" \
ghcr.io/nodebytehosting/nodejs:nodejs_20docker run -it \
-e STARTUP="npx ts-node src/index.ts" \
-v ./app:/home/container \
ghcr.io/nodebytehosting/nodejs:nodejs_20| Version | LTS Period | Status |
|---|---|---|
| 20 | Oct 2023 - Apr 2026 | Active (EOL approaching) |
| 22 | Oct 2024 - Oct 2027 | Active (Recommended) |
- npm - Latest version for each Node.js release
- Base: Alpine 3.20 via official
nodeimages - Platform: linux/amd64, linux/arm64 (multiarch)
To add support for additional Node.js versions, create new directories:
mkdir -p nodejs/24 nodejs/26Update each Dockerfile to use the desired Node.js base:
FROM node:24-alpine3.20
# ... rest of DockerfileThen add versions to the GitHub Actions workflow matrix in .github/workflows/nodejs.yml:
matrix:
version:
- "20"
- "22"
- "24"Note: We only support active LTS versions. EOL versions (18, 16, 14, 12) are not supported.
- Use
NODE_ENV=production- Disables development dependencies - Set memory limits - Use
--max-old-space-sizefor consistent performance - Enable clustering - Use Node cluster module for multi-core systems
- Use npm ci - Faster, more reliable than
npm installin containers - Minimize node_modules - Use
npm prune --productionto remove dev dependencies
The container includes build tools for native modules:
RUN npm install --build-from-sourcePre-installed: python3, make, g++ (for node-gyp compilation)
- Check
STARTUPvariable is set - Run
npm listto verify dependencies - Check application logs for errors
- Verify port binding in application
- Check container port mapping:
docker port <container>
- Increase container memory:
docker run -m 2g - Use
--max-old-space-sizeflag in Node - Monitor with
ps auxandfree -m
- Ensure
node_modulesis installed - Check
package-lock.jsonoryarn.lock - Run
npm ciornpm installin Dockerfile
MIT License - See LICENSE file for details
- Issues: https://github.com/NodeByteHosting/game-recipes/issues
- Discord: https://discord.gg/Bg3Sf5fqa4
- Node.js Docs: https://nodejs.org/en/docs/