This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/nginx | |
openssl dhparam -out dhparams.pem 2048 | |
echo "ssl_dhparam /etc/nginx/dhparams.pem;" >> /etc/nginx/ssl.conf | |
service proxy restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -it octohost/jekyll /bin/bash # already has node and npm | |
apt-get update | |
apt-get install -y git mercurial | |
curl -O https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | |
tar -C /usr/local -xzf go1.4.2.linux-amd64.tar.gz | |
export PATH=$PATH:/usr/local/go/bin | |
mkdir /src | |
export GOPATH=/src | |
export PATH="/src/bin:$PATH" | |
go get github.com/gorilla/mux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PRIVATE_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address) | |
export CONSUL_KEY=$(consul keygen) | |
service consul stop | |
rm -rf /var/cache/octohost/* | |
sudo cat > /etc/consul.d/default.json << EOL | |
{ | |
"data_dir": "/var/cache/octohost", | |
"server": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pagespeed on; | |
# Needs to exist and be writable by nginx. Use tmpfs for best performance. | |
pagespeed FileCachePath /var/ngx_pagespeed_cache; | |
pagespeed RewriteLevel PassThrough; | |
pagespeed StatisticsPath /ngx_pagespeed_statistics; | |
pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics; | |
pagespeed MessagesPath /ngx_pagespeed_message; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export CONNECT_TO="ip-address-of-first-node" | |
export PRIVATE_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address) | |
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) | |
export CONSUL_KEY="from-the-first-node" | |
export SWARM_TOKEN="from-the-first-node" | |
ufw allow 8300 | |
ufw allow 8301 | |
ufw allow from $CONNECT_TO | |
service consul stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export CONNECT_TO="ip-address-of-first-node" | |
export PRIVATE_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address) | |
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) | |
export CONSUL_KEY="from-the-first-node" | |
export SWARM_TOKEN="from-the-first-node" | |
ufw allow 8300 | |
ufw allow 8301 | |
ufw allow from $CONNECT_TO | |
service consul stop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run --rm swarm create | |
4e512cc6363c4d464817c002cd8a8bdb # your number will be different | |
export SWARM_TOKEN="4e512cc6363c4d464817c002cd8a8bdb" # your number will be different | |
docker run -d swarm join --addr=$PRIVATE_IPV4:4243 token://$SWARM_TOKEN # kill this after a minute. | |
docker run --rm swarm list token://$SWARM_TOKEN | |
docker run --restart=always -d -p 2375:2375 -t swarm manage token://$SWARM_TOKEN # only run this on the first node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ufw allow 8300 | |
ufw allow 8301 | |
export PRIVATE_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/private/0/ipv4/address) | |
export PUBLIC_IPV4=$(curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/ipv4/address) | |
export CONSUL_KEY=$(consul keygen) | |
service consul stop | |
rm -rf /var/cache/octohost/* | |
sudo cat > /etc/consul.d/default.json << EOL | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES | |
ef507fdbc928 localhost:5000/testing:latest "/bin/sh -c nginx" 4 seconds ago Up 1 seconds 10.132.38.99:32771->80/tcp octo2/desperate_sinoussi | |
447453971d08 localhost:5000/testing:latest "/bin/sh -c nginx" 13 seconds ago Up Less than a second 10.132.37.251:32770->80/tcp octo3/adoring_yonath | |
2be1c6f69ba1 localhost:5000/testing:latest "/bin/sh -c nginx" 34 seconds ago Up 3 seconds 10.132.37.251:32769->80/tcp octo3/boring_almeida | |
cc753bd4cbc4 localhost:5000/testing:latest "/bin/sh -c nginx" 52 seconds ago Up 50 seconds 10.132.38.99:32770->80/tcp octo2/drunk_ptolemy | |
e33d58128ffc localhost:5000/testing:latest "/bin/sh -c nginx" 55 seconds ago Up 53 seconds 10.132.38.99:32769->80/tcp octo2/insane_poitras | |
aca138442cfb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@oswarm1:~# docker version | |
Client version: 1.6.0 | |
Client API version: 1.18 | |
Go version (client): go1.4.2 | |
Git commit (client): 4749651 | |
OS/Arch (client): linux/amd64 | |
Server version: 1.6.0 | |
Server API version: 1.18 | |
Go version (server): go1.4.2 | |
Git commit (server): 4749651 |