Skip to content

Building: With docker compose

Bruno P. Kinoshita edited this page Apr 6, 2016 · 1 revision

If you do not want to install all dependencies for Laravel (e.g. PHP, mcrypt), or MySQL/MariaDB and ElasticSearch, you can still develop using Docker Compose.

Follow the installation instructions for your operating system. Then fork and clone our repository.

git clone https://github.com/tupilabs/speaklikeabrazilian.com.git

And then start up your Docker containers. These containers will be created using the Dockerfile in the source code, as well as the docker-compose.yml. You may tweak its settings if necessary.

cd speaklikeabrazilian.com
docker-compose up

The frontend container maps a volume to the local directory. It means that your working directory of the speaklikeabrazilian.com repository is mirrored within the container. So any changes you make to the code are reflected automatically, with no need to restart the containers, or move the code around.

Executing commands in the containers

In case you need to execute local commands in the ElasticSearch, MySQL or frontend containers, you can run the following.

docker exec -ti speaklikeabraziliancom_mysql_1 /bin/bash

After that you should be logged in as root, and be able to install other tools, load data into MySQL, and other things. However, keep in mind that you can also access MySQL and ElasticSearch from within the frontend, as the containers are linked.

In other words, once you are root in the frontend container, you are able to connect to MySQL container by using the hostname mysql, and the same for the elasticsearch hostname.