Giter VIP home page Giter VIP logo

node-docker-compose's Introduction

node-docker-compose

A production oriented dockerized node.js/express.js app. Explained in more details on my blog

Architecture

This app uses the following stack:

  • node.js and express.js
  • MongoDB database
  • nginx frontend server
  • redis
  • Kue worker

Prerequisites

This required docker, docker-machine and docker-compose installed on your local machine. More informations on Docker's website

Running locally

# creates a local host for docker containers, only do once
docker-machine create -d virtualbox local

# create your config secrets
cp .env.docker.sample .env.docker

# load the docker env
eval "$(docker-machine env local)"

# build web image
docker-compose build

docker-compose up -d

# run commands to load some test data
docker-compose run --rm app node bin/load-data

How can I make sure it works ?

  1. first you need to know your local docker machine ip, using docker-machine ls.
  2. Visit http://LOCAL_IP
  3. Check app or worker logs docker-compose logs app or docker-compose logs worker

Tutum

The big news is tutum has been acquired by Docker. Tutum is a could service to manage and deploy Docker applications. It uses a stack descriptor, which is compatible with docker-compose yaml format. So you can use my example project to deploy and mange your app with Tutum.

Considerations

docker compose is not deemed production ready. There are some limitations, mainly related to scalability. But I think it is fine for small applications. It is obviously much better to understand how docker compose works. more info on docker's website.

This template doesn't include tests or a build script. This is on purpose, to keep focus what's important here (docker).

Because of the way user gets created at startup on the mongo container, There will be a few exceptions on the app upon first start.

Credits

The template is based on node generator and node-express-mongoose-demo

node-docker-compose's People

Contributors

damsonn avatar

Watchers

 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.