Last active
June 12, 2016 05:07
-
-
Save andrewhamon/ae3bfbd66420bc3e1147e2bc0ece08d6 to your computer and use it in GitHub Desktop.
Revisions
-
andrewhamon revised this gist
Jun 12, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ function handleRequest(request, response){ if(request.url == "/healthcheck"){ response.end("Healthcheck OK") } else { numRequests++ response.end(process.env.SERVER_NAME + ' requests: ' + numRequests); } } -
andrewhamon created this gist
Jun 12, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ localhost:80 proxy / server_1:8080 server_2:8080 server_3:8080 { policy round_robin health_check /healthcheck 1s } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ FROM node COPY server.js . CMD node server.js 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ version: '2' services: server_1: build: . environment: - SERVER_NAME=server_1 server_2: build: . environment: - SERVER_NAME=server_2 server_3: build: . environment: - SERVER_NAME=server_3 caddy: image: abiosoft/caddy ports: - "80:80" volumes: - ./Caddyfile:/etc/Caddyfile depends_on: - server_1 - server_2 - server_3 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ var http = require('http') var numRequests = 0 function handleRequest(request, response){ if(request.url == "/healthcheck"){ response.end("Healthcheck OK") } else { numRequests++ response.end(process.env.SERVER_NAME + ' requests: ' + numRequests); } } var server = http.createServer(handleRequest) server.listen(8080);