Docker compose with custom project template

Hi all,

I’m trying to build a docker compose file that could build an environment by applying my custom project template. Not entirely sure if it’s possible to specify the .tar.gz (obtained from exporting a project from the GUI) in the docker-compose file as a parameters and get it applied during “docker-compose up”.

Maybe would be easier just to tell people to apply my .tar.gz template over their ready build Gitlab, but I wanted to give something complete. Any tips ?

Thanks!

Hi @godo
I am not sure what is your goal. docker compose is for spinning up containers. GitLab Project export is for backup/restore or for importing project into another GitLab instance. Those two things are usually not related in any way.

Hi Balonik,
My goal is to create a dockerfile that would build a Gitlab environment and apply my project template to it in one go. That way, someone would just run the dockerfile and have a ready to work environment.
To be honest, after reading a bit more I think the best approach is just to share the tar.gz template and people would deploy it in their existing Gitlab environment.

docker compose does not have a straight forward functionality that you seek. it is designed to spin up container images. I am not aware of any function that would allow to run some post-run tasks. Basically you need to upload the template project via API to GitLab. I think best option here is a post-deploy script or even an umbrella script that will use docker-compose to start Gitlab and then upload the project to it.