Docker
- Docker : using container technology to share the same development environment with the team
- Docker-compose : define a multi-container application in a single file (Sure, we're going to use multi-container)
Application's Stack
- Redis : a data structure server which has pub/sub feature
- MongoDB : as the primary storage
- Nodejs : just nodejs
This project use Docker and Compose to orchestrate the application's infrastructure and Git to manage the code. So, you have to install all of those first. You can choose any git client as you prefer. npm is also needed in order to manage nodejs dependencies.
After you have downloaded all of the tools, it's time to begin.
First, you have to clone this repo into your computer.
$ cd path/to/your/workspace
$ git clone https://github.com/iboss-ptk/chatroomjs.git
Then install the dependencies.
$ cd chatroomjs
$ sudo npm install -g gulp && sudo npm install -g bower
$ sudo npm install
$ bower install
We might need to run docker command on the host os because it's easier to manage. If you're not on Linux, you need to run the following commands.
$ boot2docker init # only for the first time
$ boot2docker up
$ boot2docker shellinit
Then export DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_TLS_VERIFY as it's shown after boot2docker up.
And run this command from the root directory of this repo.
$ docker-compose up
Normally, boot2docker's ip is 192.168.59.103 so the application will be on http://192.168.59.103:8888. If this doesn't show anything, try running boot2docker ip
to see your vm's ip. If you're on Linux, just http://localhost:8888.
Every component should work fine at this point. If you have any issue, feel free to ask me. If you're using windows, I can't help you much so I'd like to suggest you to use any Linux distro or OSX.