Public Repository

Last pushed: 3 months ago
Short Description
Nodejs-Sails-Alpine Linux
Full Description

This image contains an Alpine linux base, Node.js and The Sails.js for node.js framework. basically has everything you need to create a working sails application in a docker container.

Version 3.1 - Updated 1-10-2018

  • Alpine Linux 3.7
  • node.js 9.4.0
  • sails.js 0.12.14

Version 3.0 - Updated 1-2-2018

  • Alpine Linux 3.7
  • node.js 9.3.0
  • sails.js 0.12.14
    • This release is based on the Dockerfile from the official node release but rebuilt manually to upgrade Alpine to 3.7 (instead of 3.6 they are using today)

Version 2.0 - Updated 11-7-2017

  • Alpine Linux 3.6
  • node.js 8.9.0
  • sails.js 0.12.14

Version 1.2 - Updated 9-29-2017

  • Alpine Linux 3.6
  • node.js 6.11.3 (fixes CVE vulnerability)
  • sails.js 0.12.14

version: 1.1 - Updated 9-21-2017

  • Alpine Linux 3.6
  • Node.js v6.10.3
  • Sails.js 0.12.13

Sails is installed globally but it is best that you still do npm install as part of the image creation.

To use this image your Dockerfile should look something like this

FROM jnessen/sails-alpine:3.1
WORKDIR /application
COPY . /application
RUN npm install
CMD sails lift

The above Dockerfile will create an image (when built) that contains your sails application and when run lifts the sails and exposes port 1337 from the container

Basic Instructions:
$sails new <application name>
$cd <application name>
$npm install

Write all your code, build you application, etc. Remember if you have external connections to a database or something like that you will need to account for those - Maybe as a container then build a compose file to connect the sails application container and the database container.

Once your application is built issue a docker build command. This will use the Dockerfile from above to create a complete image including you code. Make sure you are in the root directory of your sails application.

$cd <application name>
$docker build -t <application name>:<tag> .

If the build completes successfully you will have an image named <application name>:<tag> on your docker host. you can now run the application container as a test using the docker run command. If you need to map the sails port to your host you can do that with the -p option.

$docker run -d [-p 1337:1337] <application name>:<tag>

Now hit the proper IP address from your browser and you should see your sails application.

Docker Pull Command