Skip to content
Thulana Kannangara edited this page Sep 19, 2017 · 19 revisions

Welcome to the orangehrm-dev-environment wiki!

What is orangehrm-dev-environment ?

Orangehrm-dev-environment is a development environment for OrangeHRM that is created using docker. This environment use three containers from orangehrm-dev-image, mysql-5.5-image and phpmyadmin-image. More information about each container can be found in their official docker-hub repositories. Please read carefully readme file provided for the repository.

How to set up ?

  1. you can take a git clone (to recieve the latest code) or download the latest stable release.
  2. extract it anywhere you want. (make sure the prerequisites are available in your host machine)
  3. open terminal and go to the extracted directory.
  4. disable ports 80 and 443 if they are used by your localhost (or follow the guide for how to use both localhost and docker container ?)
  5. run the command docker-compose up -d
  6. run docker ps and make sure dev_web , dev_mysql and dev_phpmyadmin containers are up and running.
  7. access to phpmyadmin through browser (localhost:9090)

Note - For video tutorial click here

How to install orangehrm eagle-core ?

  1. get a checkout into the ohrm_dev directory
  2. add a virtual host (follow the guide for how to create virtual host ? ) for your directory
  3. access from the browser (https://vhost)
  4. continue the usual installation

How to create virtual host ?

For the environment, virtual hosts are automated (only for orangehrm system instances).Automated virtual host will be your main directory name. To use automated virtual hosts follow the below steps.

  1. your directory path should match to /var/www/html/YOUR_DIR_NAME/symfony in container. (here /var/www/html direcoty is ohrm_dev directory in host machine)
  2. add the line 127.0.0.1 YOUR_DIR_NAME to /etc/hosts in your host machine.
  3. restart containers if needed (run docker-compose restart).
  4. access from browser (https://YOUR_DIR_NAME)

How to use both localhost and docker environment ?

In order to use localhost and docker container both at the same time you need to change the exposed ports of dev_web container. By default dev_web container exposes port 80 as 80 and port 443 as 443 to host machine.

As an example let's expose port 8080 instead of port 80 and expose port 7070 instead of port 443. To do this change the ports: section under dev_web key in docker-compose.yml .

change

ports:
      - "443:443"
      - "80:80"

to

ports:
      - "7070:443"
      - "8080:80"

Once changing the compose settings, docker compose should be restarted to get the changes applied.

docker-compose up -d

Now access from browser by typing https://vhost:7070.

Note - please do not use the port 9090, since it is used by phpmyadmin container.

How to change web root directory ?

Change the mounted volume path of web root to your own directory under dev_web -> volumes key in docker-compose.yml.

change

volumes:
      - ./ohrm_dev:/var/www/html

to

volumes:
      - YOUR_DIR_PATH:/var/www/html

How to change configuration files ?

You can find all the configuration files in /config folder. Configuration files related to apache, mysql-client, mysql-server and php are available in there. If you want, you can change them and make sure to restart containers after the changes.

How to view log files ?

Log files related to each containers and included software tools are located in /logs directory. Also you can view container log by running docker logs <containerID>.