This repository serves as a centralized repository to deploy our application. It uses git submodules
to refer to other our other repositories.
After cloning, make sure to initialize submodules, otherwise folders will be empty.
After clone this repository, you must run the following command to clone submodule repositories aswell:
git submodule update --init --recursive
As an example, I will consider a submodule called TestService
.
- Run the following command to create a submodule link to another repository
git submodule add <REPO_SSH_LINK_HERE> <REPO_FOLDER_NAME>
- Add an entry to
services
indocker-compose.yaml
:
version: '3.8'
services:
# ...
### ADD THIS
test_service:
image: test_service # image name
build:
context: ./TestService # TestService folder, created in step 1.
dockerfile: Dockerfile # Dockerfile to run TestService
###
# ...
- If it should be proxied by our reverse proxy, add an entry to the
default.conf
NGINX file:
http {
server {
# ...
location /TestService/ {
# NOTE: This address should be the address the TestService container is listening to
proxy_pass http://localhost:5000/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
}
# ...
}
}
Run the following:
git submodule update --merge --remote