OrangeHRM Development Environment
Introduction
orangehrm-dev-environment is a dockerized development environment for OrangeHRM. Usually it will take hours to configure and prepare the development environment for orangehrm system. This project will save the developers time.
This environment will depends on containers of orangehrm-dev-image,mysql and phpmyadmin.
Prerequisites
- Docker engine installed.(Get docker)
- Minimum docker version 17.3
- Minimum docker-compose version 1.12. (Get docker compose)
How to use ?
Make sure mentioned prerequisites are there in your host machine.
- go to release tab and download the latest release.
- open terminal and go to the cloned directory
- run the command
docker-compose up -d
- this command will only create three web containers and mysql 5.5 and 5.7 containers only. - To start complete development environment run the command
docker-compose -f docker-compose.yml -f docker-compose-all.yml up -d
- Moving from complete version to basic version -
docker-compose up -d --remove-orphans
- run
docker ps
and make sure all the containers are up and running. - Your web root will be /ohrm_dev directory and make sure to put your project in that folder.
Note : Video Tutorial
Containers
Container Name | Service Name in docker-compose.yml | Description | IP Address | Used Ports |
---|---|---|---|---|
dev_web_70 | web70 | PHP 7.0 | 10.5.0.70 | 9070,3000 |
dev_web_56 | web56 | PHP 5.6 | 10.5.0.56 | 9056,3001 |
dev_web_71 | web71 | PHP 7.1 | 10.5.0.71 | 9071 |
dev_mysql_55 | db55 | MySQL 5.5 | 10.5.0.5 | 3306 |
dev_mysql_57 | db57 | MySQL 5.7 | 10.5.0.6 | 3306 |
dev_mariadb_101 | db10 | MariaDB 10.1 | 10.5.0.7 | 3306 |
dev_phpmyadmin | phpmyadmin | phpMyAdmin | 10.5.0.20 | 9090 |
dev_openldap | openldap | openldap | 10.5.0.22 | 700,701 |
dev_phpldapadmin | phpldapadmin | ldapadmin | 10.5.0.21 | 9093 |
Install orangehrm eagle-core inside the container
- Get a checkout from svn to ohrm_dev directory.
- To get the named virtual hosts to work, add the project folder name to /etc/hosts file (
127.0.0.1 folderName
). - access from your browser (
https://folderName
). If you have changed the default port configuration in dev_web container then you can access usinghtttps://folderName:portNumber
- Continue installation by installing system as normal way. (you can have access to inside of dev_web_56 container by running the command
docker exec -it dev_web_56 bash
)
Default configurations
Developer can override the default configurations if they want by simply adding a docker-compose.override.yml file.It is better to have some knowledge on docker-compose file. (docker-compose file reference)
Default configurations in dev_web_56 container
ports:
- "443:443"
volumes:
- ./ohrm_dev:/var/www/html
- ./config/php5/apache2/php.ini:/etc/php5/apache2/php.ini
- ./config/php5/cli/php.ini:/etc/php5/cli/php.ini
- ./config/mysql-client:/etc/mysql
- ./config/apache2/sites-available:/etc/apache2/sites-available
- ./config/apache2/cert:/etc/apache2/cert
- ./logs/web_logs/55:/var/log/apache2
- /etc/localtime:/etc/localtime
- ./config/xhgui/config.php:/usr/local/src/xhgui/config/config.php
Example - Overriding port and web root
- Sets apache port to 8080
- Changes web root directory to /home/john/web (from default of ./ohrm_dev)
services:
web56:
ports:
- "8080:443"
volumes:
- /home/john/web:/var/www/html
If you want to change any default apache or php configurations you can find them under /config folder.
Default configurations in dev_mysql container
expose:
- "3306"
volumes:
- ./config/mysql-server:/etc/mysql
- ./logs/mysql_logs:/var/log
- /etc/localtime:/etc/localtime
- mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: 1234
You can change exposed port as mentioned in dev_web_55 container configuration. For more information about this container refer into mysql official image.
Default configurations in dev_phpmyadmin container
volumes:
- /etc/localtime:/etc/localtime
links:
- db
ports:
- "9090:80"
environment:
PMA_HOST: db
More about phpmyadmin container can find in docker hub phpmyadmin image
Additional information
- Can access a shell inside of any containers by running
docker exec -it <containerID or ContainerName> /bin/bash -c "TERM=$TERM; exec bash"
- Can restart containers using
docker-compose restart
- Can stop containers using
docker-compose stop
- Developer can find log files for each container from /logs directory. ( Also possible to get logs of containers by running the command
docker logs <container ID>
) - Developer can find configurations for apache, php, mysql-client, mysql-server, etc from _/config directory.
- If user is using Linux, the docker commands may require sudo permissions. This can be fixed by adding the user to the docker user group.
sudo usermod -aG docker <username>
- web 7.0 container doesn't include memcache,ereg and stats PHP modules due to compatibility issues.
- In web 5.6 container, port 3000 is mapped to 3000 port locally.
- In web 7.0 container, port 3000 is mapped to 3001 port locally.