setup Drupal with Docker: clone repositories via deploy token I am quite new working with docker. I tried to set up drupal via docker and docker-compose.
So far i got a running instance and installed drupal via the installation script.

No i want to clone repositoires via the Dockerfile, which is a drupal module. So after cloning and rebuilding the module should appear in the admin/modzles page)

So i edited my Dockerfile so it looks like this (the last few lines).

FROM drupal:7-apache

RUN apt-get update &amp;&amp; apt-get install -y \
        curl \
        git \
        mysql-client \
        vim \
        wget

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &amp;&amp; \
        php composer-setup.php &amp;&amp; \
        mv composer.phar /usr/local/bin/composer &amp;&amp; \
        php -r "unlink('composer-setup.php');"

RUN wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.4.2/drush.phar &amp;&amp; \
        chmod +x drush.phar &amp;&amp; \
        mv drush.phar /usr/local/bin/drush

RUN rm -rf /var/www/html/*

COPY apache-drupal.conf /etc/apache2/sites-enabled/000-default.conf

WORKDIR /app/web/sites/all/modules
RUN git clone -b &lt;branch&gt; --single-branch \
      https://&lt;deploytoken&gt;:&lt;pw&gt;@&lt;gitlab-address&gt;/&lt;path-to-git-rep&gt;.git \

WORKDIR /app


This is my docker-compose.yml

version: '3'
services:
  db:
    image: mariadb:10.2
    environment:
      MYSQL_DATABASE: drupal
      MYSQL_ROOT_PASSWORD: &lt;pswd&gt;
    volumes:
      - db_data:/var/lib/mysql
    restart: always
  drupal:
    depends_on:
      - db
    build: .
    ports:
      - "80:80"
    volumes:
      - ./app:/app
    restart: always
volumes:
  db_data:


Then i used docker-compose build and docker-compose up. It looks like the repository gets cloned and the latest images is used (no errors) but the repository is not in the folder. What did i do wrong?
The way I handle this is creating a gitlab auth.json file and with your token and using a volume mount to put it into the container.

volumes:
  - /Users/${USER}/.composer/auth.json:/home/wodby/.composer/auth.json # composer auth


In some instances I've wanted my ssh keys in there as well for certain operations, but shouldn't be needed for a pull off gitlab. This is just as easy.

volumes:
- /Users/${USER}/.ssh/id_rsa:/home/wodby/.ssh/id_rsa # ssh