Dockerized chat, based on my previous project SocketIOChatDemo, which is an example of a web application using socket.io library.
Following the Microservices architecture, the system consists on two services that run in separate containers:
- Web service: node.js server. Using the official node image.
- Database service: MongoDB database. Using the official mongo image.
Yo can find a demo, working here
$ git clone https://github.com/ageapps/docker-chat
$ cd docker-chat
$ docker-compose up
// connect in your browser to <host IP>:8080
// run mongo service
$ docker run -v "$(pwd)"/database:/data --name mongo_chat_db -d mongo mongod --smallfiles
// run docker-chat image
$ docker run -d --name node_chat_server -v "$(pwd)"/database:/data --link mongo_chat_db:db -p 8080:4000 ageapps/docker-chat
// connect in your browser to <host IP>:8080
- Docker: Software containerization platform
- SocketIOChatDemo: Chat web application.
- node.js: Server enviroment.
- MongoDB: NoSQL database system.
- mongoose: MongoDB object modeling for node.js.
- docker-build: Automated build of Docker images.
- docker-compose: Automated configuration and run of multi-container Docker applications.