Docker Community Forums

Share and learn in the Docker community.

Help: how to get / update files from gitlab repository into docker volume in production


i am using docker quite a bit for php development on my local machine and it works like a charm.

my docker compose for development:

version: "3.5"
   image: php:7.4-apache
   container_name: dev-webserver
    - ./src:/var/www/html
    - VIRTUAL_PORT=8080

i cloned my project from gitlab into the src folder and develop in there.

in the docker documentation it says I should use volumes in production not bind mounts.

    - src:/var/www/html

but how does my application get into this volume? Should I create a custom Dockerfile and git clone from there into the volume?

How do I update / pull from my repository into the containers volumes?

Thank you!