Skip to content

Instantly share code, notes, and snippets.

@jjesusfilho
Forked from BransonGitomeh/Dockerfile
Created May 19, 2018 10:16
Show Gist options
  • Save jjesusfilho/96930e43c0af9fad47ce7b36563249fe to your computer and use it in GitHub Desktop.
Save jjesusfilho/96930e43c0af9fad47ce7b36563249fe 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