Skip to content

Instantly share code, notes, and snippets.

@BransonGitomeh
Created January 27, 2018 20:35
Show Gist options
  • Save BransonGitomeh/ffa64ae9d45dad933389fc45239b9e36 to your computer and use it in GitHub Desktop.
Save BransonGitomeh/ffa64ae9d45dad933389fc45239b9e36 to your computer and use it in GitHub Desktop.
version: '2.2'
services:
awesome:
image: awesome
ports:
- 8080
scale: 20
networks:
- front-tier
- back-tier
lb:
image: dockercloud/haproxy
ports:
- 80:80
links:
- awesome
networks:
- front-tier
- back-tier
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
front-tier:
driver: bridge
back-tier:
driver: bridge
FROM node
RUN mkdir -p /usr/src/app
COPY index.js /usr/src/app
EXPOSE 8080
CMD [ "node", "/usr/src/app/index" ]
var http = require('http');
var os = require('os');
http.createServer(function (req, res) {
res.writeHead(200, {
'Content-Type': 'text/html'
});
res.end(`<h1>I'm ${os.hostname()}</h1>`);
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment