Provides a convenience Docker image to run Node services under Supervisord.
Base your image on this one to get an Alpine Linux container with latest Node.js and Supervisord pre-installed.
You can grab it directly from Docker hub via docker pull containinger/docker-node-service-host
.
Copy a service configuration file for your service (like the example below) into /etc/supervisor/conf.d/
:
[program:server]
directory=/my/working/directory
command=node run
user=node
stdout_logfile=/dev/stdout
redirect_stderr=true
stdout_logfile_maxbytes=0
autorestart=true
Optionally copy one or more script files that should run on container startup to /docker-entrypoint-initdb.d
, they will get executed before supervisord
runs (e.g. to perform mandatory initialization tasks).
All base images are based on Alpine Linux but you can influence the Node version that will be used with the NODE_VERSION
build argument.
docker build -t containinger/docker-node-service-host:latest --pull --build-arg NODE_VERSION=current .
docker build -t containinger/docker-node-service-host:14 --pull --build-arg NODE_VERSION=14 .