Currently I have a project (repo) in Gitlab which is an angular app. I'm using Gitlab CI/CD to build, test, release and deploy. Releasing will build a new docker image pushing it to the Gitlab registry and after deploying it on NGinx in a docker container on my Digital Ocean droplet. This works fine.
Let's say I want to add a backend to it like the MEAN stack so I would have 2 containers running using a docker-compose file.
- container 1 - Angular
- container 2 - Node.js, Express.js and MongoDB
The 2 gitlab projects (repo's) will have to be build separately when a change occurs (own Dockerfile and gitlab-ci.yml file) but deployed together using the docker-compose file.
Where do I manage/put the docker-compose file?
I hope my explanation is clear and if I'm assuming correctly.
Thanks in advance.
docker-compose.yml
file with dedicated integration tests in a third repository and rely on a tags naming convention to pull the proper backend / frontend versions, or maybe just have 2 repos with thedocker-compose.yml
file in the frontend repo. Otherwise, follow a so-called monorepo setup, that is a single repo with several folders and a single CI. – ErikMD.gitlab-ci.yml
YAML reference manual (docs.gitlab.com/ee/ci/yaml). Next, GitLab CI indeed supports monorepo workflows, cf. this doc page which gives an example of use of thechanges:
key; see also e.g. this article relying on Docker or that article taking advantage of theneeds:
key. – ErikMD