DarkShield / daProxy

Proxy boxes
0 stars 0 forks source link

Environment + Docker Build #45

Closed ProZachJ closed 10 years ago

ProZachJ commented 10 years ago

Issues that should be solved before this can be merged:

This docker build pulls its code off of the host not from github. This is intended to keep our code and credentials off our host machines. The only credentials that will need to be on the host is for our docker registry. Strider is responsible for pulling the code onto the host machine at build time.

We will need to write a custom testing script that doesn't require the project be installed on the host that is testing the container. I'm hoping setting up strider will provide us with a clearer picture of exactly what that script needs to look like.

Environments:

NODE_ENV=development #connects to localhost vicetest db
NODE_ENV=test  #connects to remote mongo host using 'proxytest' db
NODE_ENV=production #connects to remote mongo host using 'vicetest' db

To build and test from project root:

docker build -t proxy .
docker run -d -e NODE_ENV=test -p 5555:8080 -dns 10.245.219.212 proxy #remove -d if you want to tail the logs
npm install jasmine-node
export NODE_ENV=test
./node_modules/jasmine-node/bin/jasmine-node ./docker-proxy.spec.js

To run in production:

docker run -d -e NODE_ENV=production -p 80:80 -dns 10.245.219.212 proxy

The docker run command executes startproxy.js with pm2 in max mode. It creates a load balanced cluster with one process for each available CPU core. If you want to replicate this outside of docker just run 'npm start'.

mattjay commented 10 years ago

Opsasauraus Rex Zach.

ProZachJ commented 10 years ago

docker run -e SERVER_NAME=http://23.22.4.46 -e PLUGIN_GITHUB_APP_ID=7530aec4acca08096553 -e PLUGIN_GITHUB_APP_SECRET=4c02175ce92e7499630510d9fa7e9add0334365f -d -p 80:3000 strider/strider

ProZachJ commented 10 years ago

I am going to merge this into master. If we want to run this outside of a container in the the future there isn't anything preventing us from setting resolve.conf on the host and using npm start.

mattjay commented 10 years ago

:+1: :+1: :+1: Wow! Biggest PR ever. Nice work.