Skip to content

Instantly share code, notes, and snippets.

@evanscottgray
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evanscottgray/b247d8cc0721af32e3d1 to your computer and use it in GitHub Desktop.
Save evanscottgray/b247d8cc0721af32e3d1 to your computer and use it in GitHub Desktop.
How2DeployTenjinProxy

Temporary Deploy steps for web01.prd.iad.tenjin.pw

Temporary steps to get tenjin.pw domain working.

On salt.elevatesystems.com:

Provision the vm if it isn't already up: salt-cloud -m /srv/cloud/maps/tenjin.map

If you just did this, you'll need to create A records and all that jazz.

Ask for Highstate: salt -G 'roles:tenjin' state.highstate

On web01.prd.iad.tenjin.pw

Clone Repo!

git clone https://github.com/evanscottgray/hidocker && cd hidocker

Generate Keys!

openssl req -new -key tenjin.pw.key -out tenjin.pw.csr
openssl genrsa -des3 -passout pass:x -out tenjin.pw.pass.key 2048
openssl rsa -passin pass:x -in tenjin.pw.pass.key -out tenjin.pw.key
openssl req -new -key tenjin.pw.key -out tenjin.pw.csr
openssl x509 -req -days 365 -in tenjin.pw.csr -signkey tenjin.pw.key -out tenjin.pw.crt

Add to Dockerfile:

ADD	./tenjin.pw.crt /root/tenjin.pw.crt
ADD	./tenjin.pw.key /root/tenjin.pw.key

Changes to config.json:

{
    "server": {
        "accessLog": "/var/log/hipache_access.log",
        "port": 80,
        "workers": 5,
        "maxSockets": 100,
        "deadBackendTTL": 30,
        "address": [
            "0.0.0.0"
        ],
        "address6": [
            "::1"
        ],
        "https": {
            "port": 443,
            "key": "/root/tenjin.pw.key",
            "cert": "/root/tenjin.pw.crt"
        }
    },
    "redisHost": "127.0.0.1",
    "redisPort": 6379,
    "redisDatabase": 0
}

Build new container: `docker build --tag="tenjin/hidocker" .``

Start new container: docker run -d -p 80:80 -p 443:443 -p 6379:6379 tenjin/hidocker

On any host with redis-cli and connectivity to tenjin.pw:

Push vhost!

redis-cli -h tenjin.pw -p 6379 rpush frontend:tenjin.pw tenjin
redis-cli -h tenjin.pw -p 6379 rpush frontend:tenjin.pw http://sogarcia.evanscottgray.com:2345

To take it all down

On salt.elevatesystems.com:

Kill all the Tenjin. salt-cloud -m /srv/cloud/maps/tenjin.map -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment