Git Product home page Git Product logo

alpine-node's Introduction

Base Alpine Linux Node.js Docker images

Homemade grass-fed lightweight base images for Node.js on top of Alpine Linux for super tiny secure and efficient Node.js containers.

Motivation

While there are already existing Alpine Linux Node.js images, none allows us to extend them in a building context; using any Node.js module requiring compilation force us to explicitly download again all build tools and Python.

That's why we made this repo, to build an Alpine Linux Node.js Docker image including all build dependencies, where you can install modules that require compilation without extra steps.

Usage

docker build -t alpine-node --rm .

You can configure the NODE_VERSION and NPM_VERSION build arguments:

docker build -t alpine-node --rm . \
    --build-arg NODE_VERSION=4.2.6 \
    --build-arg NPM_VERSION=3

Note: NODE_VERSION have to be the exact version, while NPM_VERSION supports any npm install specification.

Example

Here's an example Dockerfile to build a Node.js application with modules requiring compilation, on top of our base image:

FROM alpine-node:dev

RUN mkdir /app
WORKDIR /app

COPY package.json .
RUN npm install --production
COPY . .

CMD npm start

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.