For all the following, DO NOT run docker or make commande as root or with sudo, use this setup: add your user to the docker user group, re-login, and restart docker.service.
### get the sites/default/salt.txt file (if you don't have it, you don't)
### get the sites/default/files folder
rsync the files from you know where (if you don't, you don't) to src/sites/default/files/
### xdebug
copy ```ressources/xdebug.ini.exemple``` to ```ressources/xdebug.ini``` and edit the ```xdebug.remote_host``` ip to your host locale ip (e.g. : 192.168.0.23) (or once the docker is started to the host ip from the container point of vu e.g. 172.21.0.1)
## Mysql
Copy your-sql-dump.sql files into ```./ressources/erable.sql```
They will be automaticly imported into the mysql containers dbs (only) on the first docker-compose up
## Hosts and reverse proxy
add to your /etc/hosts :
```
127.0.0.1 dev.erable.fr
127.0.0.1 dev.phpmyadmin.erable.fr
```
configure your vhosts to add a reverse proxy that will redirect the dev.materio.com to our container
For all the following, DO NOT run docker or make commande as root or with sudo, use your regular user but first add your user to the docker user group, re-login, and restart docker.service.
/!\ DO NOT use ```docker-compose build```, it will fail (check Makefile for more info)
```sh
make build
```
### run
then each time you want to launch the app
```sh
make up
```
Be aware that a first up, since the db is empty, it will be populated with your files ressources/db_d7.sql and ressources/db_d9.sql. It may take some time depending of your db size.
## Drupal Composer install
Only at first up, finish to install drupal 9 composer dependencies
```sh
make exec_php
composer install
# or juste
make composer_install
```
## Visualize
You can now visit http://dev.d7.erable.archi.fr and http://dev.d9.erable.archi.fr on your browser
After the first run
## Coding
### drush
you can access to drush by loging into the php container
```sh
make exec_php
```
once inside the php container in /var/www/html you can use drush as usual
## Updating code
```sh
git pull figli master
# then update all submodules
git submodule update --recursive --checkout
# if you updated d9 code then run
make maj_config
```
## Updating manualy the mysql db
copy your db backup into the mysql container
```sh
docker cp your-db-file.sql erable-mysql-1:/root/
```
log into mysql container
```sh
make exec_mysql
```
once inside the mysql container you can use mysql command to drop then create and load the db with your file
```
mysql -uroot -perable
> drop database erable;
> create database erable;
> exit;
mysql -uroot -perable erable <your-db-file-name.sql
```
## Makefile
DO NOT use directly docker or docker-compose to run this instance