- Clone repository
- Create
.envfile based on.env.template - Execute command to rebuild submodules
git submodule update --init --recursive - Run
docker compose up --buildto start - Run
docker compose -f docker-compose.prod.yml build --no-cachefor Production
- Create a new repository on GitHub
- Clone the repository on local machine
- Add the submodule, where
repository_urlis the url of the repository anddirectory_nameis the name of the folder where you want the submodule to be stored (it should not exist in the project)
git submodule add <repository_url> <directory_name>
- Add changes to repository (git add, git commit, git push) Ex:
git add .
git commit -m ‘Add submodule’
git push
- Initialise and update Sub-modules, when someone clones the repository for the first time, they should run the following command to initialise and update the sub-modules
git submodule update --init --recursive
- To update the submodule references
git submodule update --remote
- Clone the repository
- Create .env based on .env.template
- Run following command
docker compose -f docker-compose.prod.yml build
Run containers
docker compose -f docker-compose.prod.yml up
If working in the repository that has the sub-modules, first update and push the sub-module and then the main repository.
If you do it the other way around, you will lose references to the sub-modules in the main repository and you will have to resolve conflicts.