Skip to content

Getting Started

alexanderkoller edited this page Feb 1, 2018 · 2 revisions

Getting Started

The instructions below explain how to start a local copy of the EHB2 application system on your own computer.

Prerequisites

Install Docker on your computer. Make sure you can run docker-compose from the command line.

Create a file docker-compose-private.yml, as described in the README.

Setting up the database

In general, you start the EHB2 system using docker-compose as follows:

docker-compose -f docker-compose.yml -f docker-compose-private.yml up

This will create, among other things, a directory on your computer called mysql_data (check: is it below the current working directory or below the location of docker-compose.yml?), and store the files for a MySQL database server in it. The first time you run the EHB2 system, EHB2 is looking for a database there and won't find it, because you haven't set it up yet. It will fail with an error message that looks like this:

ehb2     | pymysql.err.InternalError: (1049, "Unknown database 'ehb2017'")

Thus, cancel docker-compose and edit docker-compose.yml so the entry for phpmyadmin is not commented out. Restart docker-compose. You should see, among others, the following line:

pma           | 2018-02-01 09:24:37,619 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

Go to http://localhost:8080 to access the phpMyAdmin container you just started, and log in as root with the password you specified in the mysql container in docker-compose.yml. Then do the following on the phpMyAdmin website:

  • Go to the "Databases" tab and create a new database for your installment of EHB. Make sure that you edit your docker-compose-private.yml so the DB_URL field uses this database.
  • Go to the "Import" tab in phpMyAdmin and upload the SQL script for creating the necessary tables in your database.

Cancel docker-compose. Feel free to comment the phpmyadmin container back out if you like.

Starting the EHB2 system

Start docker-compose as described above. You should see the following line:

ehb2          | Starting Tornado webserver on port 5000.

At this point, you can connect to the EHB2 system by navigating your web browser to http://localhost:5000 (or whatever port you specified under SERVER_PORT in docker-compose-private.yml.

Common error messages

Problem:

ERROR: for mysql  Cannot create container for service mysql: Conflict. The container name "/mysql" is already in use by container "e8d49b803c1b9b0b2e107cd9f612a792fba15a060c39d5304c9f87f8ffb227cc". You have to remove (or rename) that container to be able to reuse that name.

Solution:

Check docker ps -a for Docker containers called mysql. You need to shut these down and remove them before you can start the EHB2 system. Use docker kill xxx to kill the running container (where xxx is the container ID displayed by docker ps), and then use docker rm xxx to remove the container.