Project Setup - kkemple/awesome-enterprise-web-service GitHub Wiki

Install Docker and DNS management tools via Phase2 devtools

Devtools is essentially a Docker machine manager... on steriods.

Some of the benefits of using devtools are:

- Persistent Data w/ Back Up Support
- DNS Management between host and virtual machine
- Domain name aliasing for easier container-to-container communication **AND** host-to-virtual communication (http://<prefix>.<domain>.vm)
- Faster file syncing via NFS

Devtools will also set up a resolver for routing the .vm domain to the Docker Machine IP. This lets you access all of your containers from both the host and within the Docker machine by the same domain name. This makes working with distributed systems a lot easier and keeps apps cleaner by removing the need for Docker specific environment variables.

brew tap phase2/devtools

brew install phase2/devtools

devtools doctor

# if problems from doctor command install recommended binaries
brew install phase2/devtools/docker-machine
brew install phase2/devtools/docker-compose
brew install phase2/devtools/docker

# stop docker-machine dev if it's already running
devtools start

If you run docker ps you will see you already have two running containers, dnsdock and dnsmasq.

Run Tests

# start docker machine via devtools
# devtools start

# stop dev dependencies if running
# ./docker-stop-dev-dependencies.sh

./docker-start-test-dependencies.sh
./docker-run-test.sh

Run Docker Services

# start docker machine via devtools
# devtools start

# stop test dependencies if running
# ./docker-stop-test-dependencies.sh

./docker-start-dev-dependencies.sh
./docker-run-dev.sh

Endpoints

http://local.webservice.vm:8080 #API
http://local.webservice.vm:8080/documentation #API Documentation
http://local.webservice.vm:8081 #Sockets
http://db.webservice.vm:3306 #MySQL
http://cache.webservice.vm:6379 #Redis
http://statsd.webservice.vm:8126 #statsd admin interface (no GUI)
http://statsd.webservice.vm #Graphite Interface for viewing statsd metrics

Running without Docker

Make sure you have mysql, redis, and statsd* available, either locally or remotely. Then make sure you have all of the required environment variables set.

* optional

Run npm run db:migrate && npm run db:seed:all to populate the database.

Run npm serve to start nodemon

Endpoints

http://localhost:8080 #API
http://localhost:8080/documentation #API Documentation
http://localhost:8081 #Sockets
⚠️ **GitHub.com Fallback** ⚠️