Answer the question
In order to leave comments, you need to log in
How to build nginx, front, back bundle with docker-compose?
Hello!
There are two projects: front on Vue.js and back on Nest.js. Each project, of course, lies in its own repository on Gitlab. I use Gitlab CI/CD to build and deliver to VPS. Nginx is configured in a front-end project. The backend project knows nothing about nginx.
I tried to keep nginx with docker-compose in a separate project, it's convenient, but ... you have to deploy manually, because. this project knows nothing about front and back.
Actually the question itself: how to tie this whole thing to docker-compose in order to have one config for the whole bunch?
I believe silver on Gitlab solves this problem with Multi-project pipelines . What other options might there be?
Answer the question
In order to leave comments, you need to log in
And what exactly is the problem?
Gitlab CI/CD downloads a new version of the repository - to ./local-back or ./local-front, and restarts docker-compose
docker-compose.yml which is in the folder above looks something like this:
nginx:
...
volumes:
- ./local-back:/container/back
- ./local-front:/container/front
...
back:
...
volumes:
-./local-back:/container/back
command: тут скрипт который конфигурит бэк и запускает его
front:
...
volumes:
-./local-front:/container/front
command: тут скрипт который конфигурит фронт, собирает статику, или что он там делает..
The backend project knows nothing about nginx.
And why one config for different projects?
I tried to keep nginx with docker-compose in a separate project, it's convenient, but ... you have to deploy manually, because. this project knows nothing about front and back.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question