Public Repository

Last pushed: 2 years ago
Short Description
Minimal Docker image for NodeJS, built on Alpine
Full Description

Minimal NodeJS Docker Image

This image is built on Alpine Linux Edge Version to maintain small footprint

Available Versions

Current Versions

  1. latest, 6.6.0 with NPM v3.10.7

LTS Versions

  1. lts, 4.5.0 with NPM v2.15.11

Check Tags to find out available NodeJS version

Checking Versions

To run container run the following command

$docker run --rm --name node_v nmrony/alpine-node node -v
$docker run --rm --name npm_v nmrony/alpine-node npm -v

Using as Base Image

If you want to use it as your base image you your Dockerfile should look like below

FROM nmrony/alpine-node
# FROM nmrony/alpine-node:6.6.0
# FROM nmrony/alpine-node:lts
# FROM nmrony/alpine-node:4.5.0

ADD . .

# If you have to compile modules with node-gyp,
# you'll need extra tools. Uncomment the line below
# RUN apk add --no-cache make gcc g++ python

RUN npm install

# Replace app-port with your own one
EXPOSE [app-port]

# Replace app-entrypoint.js with your own one
CMD ["node", "app-entrypoint.js"]

Running your App

To run your App run the following command given below (You need to change the path and command to reflect your app path)

$cd /path/to/project/root
#install dependencies
$docker run --rm --name awesome_node_app_install -v $(pwd):/app -w /app nmrony/alpine-node npm i
#Running App
$docker run --name awesome_node_app -v $(pwd):/app -w /app -p 80:<your-app-port> nmrony/alpine-node node [app-entrypoint.js]
Docker Pull Command