Skip to content

A proof of concept for development using controlled persistence with docker. A load balanced, compartmentalized node.js application with mongodb, redis, and nginx.

Notifications You must be signed in to change notification settings

LevInteractive/docker-nodejs-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

This can be used as a boilerplate for a node project. The benefit to using docker is that it allows you to manage your environment is to make sure all environments are consistent from the developers to the production server. It also saves you a ton of time.

How do I use it?

First you should have a general understanding of what docker and docker-compose are and make sure they're installed on your machine. For Linux it's a snap. For OS X, there are a few extra steps but it really isn't that bad.

The idea is pretty simple. You can tweak the volumes in the docker-compose.yml to match your enviornment and get going. Optionally, you can create another copy for a specific environment.

# Get it up.
docker-compose up -p my-container

# Now you should be able to visit localhost or (<boot2docker ip>) if on a mac.
# So something like this:
# http://192.168.59.103:8080/ <=== Port forwarded for the node app running locally. 8080:8080
# http://192.168.59.103:8888/ <=== Port forwarded from port 80 being run by nginx.  8888:80

# In production, obviously you wouldn't need to forward these ports if DNS is setup and nginx
# is running on port 80. Feel free to tweak nginx/* and just re-run: docker-compose build.

# Rebuilds Dockfile if you made changes to that.
docker-compose build && docker-compose up

# Build from scratch.
docker-compose build --no-cache web && docker-compose up

About

A proof of concept for development using controlled persistence with docker. A load balanced, compartmentalized node.js application with mongodb, redis, and nginx.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published