Docker Community Forums

Share and learn in the Docker community.

How to connect host file with gtilab docker container?

Hi guys! I hope you are fine :slight_smile: I am new in Gitlab and docker and this is an opportunity for me to expand my knowledge.

My problem is simple to think but for me is difficult to implement.

I have a virtual Machine running Ubuntu 18.04 LTS and in this machine I have docker installed. I have two containers:

  • Gitlab
  • php-apache2.4

My thoughts was to deploy my php website through gitlab and see the changes instantly. Until know let me describe the steps I have done.

Gitlab is running like a charm.
Considering the container of php-apache2.4 I have connected it with a volume so I have a file htdocs that I have tested it and when I do a change manually it shows on web like a charm again.
Also I have register the gitlab runner.

My third step and this is the more important is that:
I want to connect my gitlab-ci.yml with the file that contains all the files of the website(htdocs). In other words my htdocs file that is on my host machine, I want this file to be connected with the gitlab so whatver change I make in gitlab reposiroty, I will have the ability to see that change.

If you need some more informations let me know so we can reach the goal.

Thanks for your time!!!