I tried to do a clone via Git on my docker compose, but i'm just started using a docker and i don't know how can i do it.
I want to do a download inside de apache (document root) /var/www/html.
The line is: command: bash -c "git clone [email protected]:user/project.git"
version: '3.8'
services:
mysql:
image: mysql:8.0.21
command: --default-authentication-plugin=mysql_native_password
restart: always
container_name: mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=user
- MYSQL_PASSWORD=pass
- MYSQL_MAX_ALLOWED_PACKET=1024M
- MYSQL_INNODB_BUFFER_POOL_SIZE=1G
- MYSQL_INNODB_LOG_FILE_SIZE=256M
- MYSQL_INNODB_LOG_BUFFER_SIZE=256M
ports:
- '3361:3360'
volumes:
- "./docker/mysql:/docker-entrypoint-initdb.d"
apache:
image: php:7.4.11-apache
restart: always
container_name: apache
ports:
- '8081:80'
- '443:8443'
volumes:
- ./docker/www:/var/www/html
command: bash -c "git clone [email protected]:user/project.git"
environment:
XDEBUG_CONFIG: "remote_enable=1 remote_host=192.168.15.21 remote_port=8081 remote_autostart=1"
depends_on:
- mysql
links:
- mysql
phpmyadmin:
image: phpmyadmin:latest
restart: always
container_name: phpmyadmin
ports:
- 8080:80
depends_on:
- mysql
environment:
- PMA_ARBITRARY=1
volumes:
- "./docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php"
git
command there. You can add some artifacts like thisdocker-compose.yml
file and theDockerfile
you need to build your custom image into the root of the repository as well.