Git Product home page Git Product logo

sails-docker-boilerplate's Introduction

Sails-Docker-Boilerplate

This project contains a fresh Sails application (v0.12.0-rc3) using the sails new command. The Dockerfile is configured to use Node.js version 4.0.

You use this repo to develop a new Sails app on your local machine using Docker Compose. Docker compose is a tool that enables you to configure each application or service you want in your system and runs each one in a separate container. Docker protects your development machine from being polluted with extraneous software and enables you to lock-down specific versions of the software used, which eases migration to newer versions of database servers, OSes, etc.

How to use this project:

  • Fork this repo, then clone to your machine:

    → git clone https://github.com/{github username}/sails-docker-boilerplate.git {myapp-name}

    Replace {github username} and {myapp-name} with your names.

  • Install Docker Toolbox. If you have a preferred and trusted way of installing docker tools, that's fine too. As long as you have access to the latest Docker.

TIP: if your development machine has ample RAM and disk space, you can create a virtual machine that is larger than the default. I use:

→ docker-machine create -d virtualbox --virtualbox-cpu-count=4 --virtualbox-disk-size=40960 --virtualbox-memory=4096 default

creates a virtualbox VM at 40GB disk and 4GB RAM with 4 CPU cores

  • Add your Docker machine's environment variables for your shell:

    # ~/.bash_profile or ~/.profile
    # set Docker environment variables using docker-machine
    test -f /usr/local/bin/docker-machine && eval $($_ env default)

    Then restart your shell. If you're on Windows, good luck!

  • Build the Dockerfile:

    → docker-compose build
  • Install the node dependencies. This must be done by running NPM inside of the container, since it is a specific flavor of Linux:

    → docker-compose run sails npm install
  • If there were no errors in the previous step, you can lift sails:

    → docker-compose up
  • And, open the app in your favorite browser on OS/X:

    → open http://$(docker-machine ip default):1337

    this should open up a page that looks like:

    Image of default sails page

sails-docker-boilerplate's People

Watchers

James Cloos avatar  avatar  avatar

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.