Setting Up Development Enviromnent using Docker
Prerequisites
- Install Docker on your machine
- Have your account on project.samarth.ac.in - GitLab
- Install Git on your machine
- Gitlab/Bitbucket credentials for
auth.json
- For windows users, enable WSL and ensure BIOS level virtualization is enabled.
Folder Structure
Create a root folder
uims
in the home directory.Create two folders inside the
uims
folder:- uims
|- docker/
|- submodules/docker
- This folder will contain the base repositorysubmodules
- This folder will contain all the submodules that are being used for development
Cloning the Base Repository
Clone the base repository into the docker folder and checkout the docker branch
git clone <repository url> docker
Cloning Submodules repositories
Clone any submodule(s) that you wish to work on.
cd submodules
git clone <repository url>
To avoid errors during cloning use SSH or use the following command for https:
git clone -b <branch name> --single-branch <repository url>
Setting up Docker Environment
Go to
uims/docker
.Remove the version of the submodule you wish to work on from
composer.json
file and replace with*
. example://change this
"uims/employee": "dev-new-ux",
//to this
"uims/employee": "*",Add the following to the top of the
repositories
section in thecomposer.json
file. Replace<module directory name>
with the directory name of the submodule you cloned.{
"type": "path",
"url": "../submodules/<module directory name>"
},
Starting the Docker Environment
Open terminal/command prompt inside the
uims/docker
directory.Run the following command:
docker-compose -f docker-compose.yml up -d --remove-orphans
Now open the Docker Dashboard.
Go to Containers. You will have a running container named
docker
. Expand it view all the running services.Click the actions icon next to the container named
php-uims
and click Open in terminalInstall the required packages.
apt update
apt install gitFinally, install the composer packages.
php composer.phar update
🎉Congratulations🎉 Your development environment is all set. Go to http://localhost:8080 to view the application.
Shutting Down Docker
To shut down the environment simply click the stop button in the actions column on the Docker Dashboard.