First change to the mysql directory:
cd mysql/To allow for the databases to persist in the image, we use the following Dockerfile:
FROM mysql:latest
RUN cp -r /var/lib/mysql /var/lib/mysql-no-volume
CMD ["--datadir", "/var/lib/mysql-no-volume"]
Next, build and run,
docker build . -t o-mysql
docker run -p 3306:3306 \
--name <db-container-name> \
-e MYSQL_ROOT_PASSWORD=<root_password> \
-e MYSQL_USER=<username> \
-e MYSQL_PASSWORD=<password> \
-ti o-mysqlNote that in some systems you might have to use
sudo dockerinstead ofdocker.
You can given any tag to the image instead of o-mysql.
Use the create and populate scripts.
docker exec -it <db-container-name> mysql -uroot -p -e "$(cat createdb.sql)"docker exec -it <db-container-name> mysql -u<username> -p -e "$(cat popualtedb.sql)"From the repository root, change to the nodejs directory:
cd nodejs/Build and run the docker image,
docker build -t o-nodejs .
docker run -p 8080:8080 -d o-nodejsAgain, you can give any name to the image that is built here.
From the repository root, change to the rocketchat directory:
cd rocketchat/We will be using the docket-compose.yml file (you can modify some of the option, if needed). In particular, you need to replace the ROOT_URL field with the appropriate URL.
Also, we are going to use the
/dataand/uploadsdirectory on the host to store the data. Make sure that those directories exist and have the correct permissions.
docker-compose up -d mongo
docker-compose up -d mongo-init-replica
docker-compose up -d rocketchatAfter setting up the application by visiting the URL on a browser, you can create a bot to talk to. Edit the file docker-compose.yml again to change the variables ROCKETCHAT_USER and ROCKETCHAT_PASSWORD in the hubot section and then start up hubot:
docker-compose up -d hubotMore details are available here.