setup update

This commit is contained in:
2021-05-10 21:16:45 +02:00
parent 5f5e0e8404
commit a07ba07087
12 changed files with 903 additions and 62 deletions

109
README.md
View File

@@ -36,7 +36,7 @@ cp -r ressources/d9/settings.php src_d9/web/sites/default/
```
### get the sites/default/files folder
get the files from where you have it and rsync it to src_d7/sites/default/files/ and src_d9/web/sites/default/files/
rsync the files from you know where (if you don't, you don't) to src_d7/sites/default/files/ and src_d9/web/sites/default/files/
## Mysql
Copy your-sql-dump.sql into ./ressources/db_d7.sql or ./ressources/db_d9.sql
@@ -50,39 +50,8 @@ add to your /etc/hosts :
127.0.0.1 dev.d9.popsu.archi.fr
127.0.0.1 dev.phpmyadmin.popsu.archi.fr
```
configure your apache vhosts to add a reverse proxy that will redirect the dev.materio.com to our container
```apache
<Virtualhost *:80>
ServerName dev.d7.popsu.archi.fr
ProxyPass / http://127.0.0.1:8980/
ProxyPassReverse / http://127.0.0.1:8980/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
<Virtualhost *:80>
ServerName dev.d9.popsu.archi.fr
ProxyPass / http://127.0.0.1:8980/
ProxyPassReverse / http://127.0.0.1:8980/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
<Virtualhost *:80>
ServerName dev.phpmyadmin.popsu.archi.fr
ProxyPass / http://127.0.0.1:8981/
ProxyPassReverse / http://127.0.0.1:8981/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
```
configure your vhosts to add a reverse proxy that will redirect the dev.materio.com to our container
nginx
```nginx
server {
@@ -122,42 +91,77 @@ server {
}
```
apache
```apache
<Virtualhost *:80>
ServerName dev.d7.popsu.archi.fr
ProxyPass / http://127.0.0.1:8980/
ProxyPassReverse / http://127.0.0.1:8980/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
<Virtualhost *:80>
ServerName dev.d9.popsu.archi.fr
ProxyPass / http://127.0.0.1:8980/
ProxyPassReverse / http://127.0.0.1:8980/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
<Virtualhost *:80>
ServerName dev.phpmyadmin.popsu.archi.fr
ProxyPass / http://127.0.0.1:8981/
ProxyPassReverse / http://127.0.0.1:8981/
ProxyRequests Off
ProxyPreserveHost On
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
</Virtualhost>
```
## Docker
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.
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.
```sh
usermod -aG docker yourusername
# https://wiki.archlinux.org/title/Docker#Installation
restart
```
### docker-compose pull
pull the latest image of services
```
```sh
make pull
```
### build
only before the first run (may take some time)
```
/!\ DO NOT use ```docker-compose build```, it will fail (check Makefile for more info)
```sh
make build
```
/!\ DO NOT use ```docker-compose build```, it will faile
### 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
but first we need to downgrade composer to version 1
(you'll need to do this downgrade every time you make_down then make_up)
```
docker exec -u 0 -it popsu_php_d9_1 /bin/bash
composer selfupdate --1
```
ctrl+d
```
```sh
make exec_php_d9
composer install
# or juste
make d9_composer_install
```
## Visualize
@@ -167,7 +171,7 @@ After the first run
## Coding
### drush
you can access to drush by loging into the php container
```
```sh
make exec_php_d7
# or
make exec_php_d9
@@ -177,18 +181,19 @@ 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
# or only one
# or only d7
git submodule update --checkout src_d7/
# or
# or only d9
git submodule update --checkout src_d9/
# if you updated d9 code then run
make d9_maj_config
```
## Updating manualy mysql db
## Updating manualy the mysql db
copy your db backup into the mysql container
```sh
docker cp your-db-file.sql popsu_mysql_d7_1:/root/