- Install Docker: https://docs.docker.com/get-docker/
- Install Docker-Compose: https://docs.docker.com/compose/install/
- Install Python: https://www.python.org/downloads/
Enable recursion for relevant commands, such that regular commands recurse into submodules by default (e.g. fetch, pull, etc.).
git config --global submodule.recurse trueEnable a summary of the submodule status when running git status.
git config --global status.submoduleSummary trueClearer container diffs when referenced submodule commits changed in git diff.
git config --global diff.submodule logExtra: Pretty print commit history with git lg.
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"git clone --recurse-submodules --remote-submodules git@github.com:CS401-Team-Project/Smart-Ledger.gitNote: The SSH string is preferred if your GitHub account is linked to your machine using an SSH key; otherwise, use the HTTPS string.
Important: Submodules are always checked out in a detached HEAD state.
Make sure to check out the desired branch for both Front-End and Back-End submodules (e.g.: main or another
development branch).
Either check out the desired branches on each submodule individually with:
git checkout <branch>or check out the same branch recursively:
git submodule foreach "git checkout <branch>"- Uses NGINX reverse proxy to serve static files from the Front-End submodule.
- Front-End -
http://127.0.0.1 - Back-End (API) -
http://127.0.0.1/api - Compose file:
docker-compose-prod.yml- Ex:
docker-compose -f docker-compose-prod.yml up --build
- Ex:
- Doesn't use NGINX reverse proxy.
- Front-End -
http://127.0.0.1:3000 - Back-End (API) -
http://127.0.0.1:5000 - Compose file:
docker-compose.yml
Helper script scripts.py:
- Provides a user-friendly interface to perform a sequence of docker-compose commands.
- Stop and Remove Containers
- Optionally remove all images, volumes, and orphans.
- Build/Rebuild
- Create Containers & Start
- Print Logs
- Inspect Containers
- Stop and Remove Containers
- Use Space to select 1 or more options, and Enter to confirm.
- Install the module requirements:
pip install -r requirements.txt
- Build and run the containers:
- Normal:
docker-compose up - Detached:
docker-compose up -d - More info: https://docs.docker.com/compose/reference/up/
- Normal:
- If changes are made to the Docker files, you will need to re-build the docker image:
- Build only:
docker-compose build - Up + rebuild:
docker-compose up --build - Up detached + rebuild:
docker-compose up --build -d
- Build only:
- Stop and remove containers and networks for services defined in the Compose file:
2.
docker-compose down3. Optionally remove images, volumes, and orphans: 1. Arguments:--rmi all,-v,--remove-orphans4. More info: https://docs.docker.com/compose/reference/down/ - View running containers:
docker-compose ps - Drop into a shell:
docker-compose exec -it <container_name> bash - View logs:
- All:
docker-compose logs - Specific container:
docker-compose logs <container_name>
- All: