drupal mathallo is running

This commit is contained in:
2025-10-30 11:02:14 +01:00
parent ee1686340b
commit b453047cc1
9 changed files with 138 additions and 62 deletions

12
.env
View File

@@ -1,12 +1,12 @@
COMPOSE_PROJECT_NAME=epau COMPOSE_PROJECT_NAME=mathallo
PROJECT_ROOT=./src PROJECT_ROOT=./src
LOG_ROOT=./log LOG_ROOT=./log
DB_IMPORTE_FILE=./ressources/epau.sql DB_IMPORTE_FILE=./ressources/mathallo.sql
DB_ROOT_PASSWORD=epau DB_ROOT_PASSWORD=mathallo
DB_NAME=epau DB_NAME=mathallo
DB_USERNAME=epau DB_USERNAME=mathallo
DB_PASSWORD=epau DB_PASSWORD=mathallo
XDEBUG_INI=./ressources/xdebug.ini XDEBUG_INI=./ressources/xdebug.ini

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "src"] [submodule "src"]
path = src path = src
url = https://figureslibres.io/gitea/bachir/drupal-epau.git url = https://figureslibres.io/gitea/bachir/drupal-mathallo.git

View File

@@ -1,8 +1,8 @@
server { server {
listen 80; listen 80;
root /var/www/epau/web; root /var/www/mathallo/web;
index index.html index.php; index index.html index.php;
server_name dev.epau.fr; server_name dev.mathallo.fr;
charset utf-8; charset utf-8;
@@ -14,7 +14,7 @@ server {
location = /robots.txt { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; }
access_log on; access_log on;
error_log /var/log/nginx/epau/error.log error; error_log /var/log/nginx/mathallo/error.log error;
sendfile off; sendfile off;

View File

@@ -38,28 +38,28 @@ ps:
logs: logs:
docker-compose logs -f docker-compose logs -f
maj_config: crd composer_install updb cim cr pag #dev.phpmyadmin.epau.fr maj_config: crd composer_install updb cim cr pag #dev.phpmyadmin.mathallo.fr
crd: crd:
docker exec epau-php-1 /bin/bash -c "drush cache-clear drush" docker exec mathallo-php-1 /bin/bash -c "drush cache-clear drush"
composer_install: composer_install:
docker exec epau-php-1 /bin/bash -c "composer install --no-dev" docker exec mathallo-php-1 /bin/bash -c "composer install --no-dev"
updb: updb:
docker exec epau-php-1 /bin/bash -c "drush updb -y" docker exec mathallo-php-1 /bin/bash -c "drush updb -y"
cim: cim:
docker exec epau-php-1 /bin/bash -c "drush config-import -y" docker exec mathallo-php-1 /bin/bash -c "drush config-import -y"
# sync_struct: # sync_struct:
# docker exec epau-php-1 /bin/bash -c "drush im --choice safe && drush ib --choice full" # docker exec mathallo-php-1 /bin/bash -c "drush im --choice safe && drush ib --choice full"
cr: cr:
docker exec epau-php-1 /bin/bash -c "drush cr" docker exec mathallo-php-1 /bin/bash -c "drush cr"
pag: pag:
docker exec epau-php-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term" docker exec mathallo-php-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term"
restart_nginx: restart_nginx:
docker-compose restart nginx docker-compose restart nginx
@@ -71,13 +71,13 @@ down:
docker-compose down docker-compose down
exec_nginx: exec_nginx:
docker exec -it epau-nginx-1 bash docker exec -it mathallo-nginx-1 bash
exec_php: exec_php:
docker exec -it epau-php-1 bash docker exec -it mathallo-php-1 bash
exec_mysql: exec_mysql:
docker exec -it epau-mysql-1 bash docker exec -it mathallo-mysql-1 bash
dump_db: dump_db:
docker exec epau-mysql-1 sh -c 'exec mysqldump -uroot -pepau epau' > ./ressources/epau-$(DATE_NOW)-local.sql docker exec mathallo-mysql-1 sh -c 'exec mysqldump -uroot -pmathallo mathallo' > ./ressources/mathallo-$(DATE_NOW)-local.sql

View File

@@ -1,6 +1,6 @@
# epau Docker # mathallo Docker
epau powered by druapl 10 in docker environement (nginx, php:8.3-fpm+drush, mariadb, redis, phpmyadmin, x-debug) mathallo powered by druapl 10 in docker environement (nginx, php:8.3-fpm+drush, mariadb, redis, phpmyadmin, x-debug)
## Install docker ## Install docker
``` ```
@@ -17,19 +17,19 @@ https://wiki.archlinux.org/index.php/Docker#Installation
## Clone this repos ## Clone this repos
this will clone this repos (main docker environement) and the epau.arch.fr drupal 9 source code (without sites/default folder nor mysq ddbs) this will clone this repos (main docker environement) and the mathallo.arch.fr drupal 9 source code (without sites/default folder nor mysq ddbs)
``` ```
git clone --recursive -o figli https://figureslibres.io/gitea/bachir/docker-epau.git git clone --recursive -o figli https://figureslibres.io/gitea/bachir/docker-mathallo.git
``` ```
submodules : submodules :
- https://figureslibres.io/gitea/bachir/drupal-epau - https://figureslibres.io/gitea/bachir/drupal-mathallo
## touch log file ## touch log file
``` ```
touch log/nginx/error.log touch log/nginx/error.log
touch log/nginx/epau/error.log touch log/nginx/mathallo/error.log
``` ```
### setup /sites/default/settings.php ### setup /sites/default/settings.php
@@ -45,31 +45,31 @@ cp -r ressources/drupal/services.yml src/web/sites/default/
rsync the files from you know where (if you don't, you don't) to src/sites/default/files/ rsync the files from you know where (if you don't, you don't) to src/sites/default/files/
## Mysql ## Mysql
Copy your-sql-dump.sql files into ```./ressources/epau.sql``` Copy your-sql-dump.sql files into ```./ressources/mathallo.sql```
They will be automaticly imported into the mysql containers dbs (only) on the first docker-compose up They will be automaticly imported into the mysql containers dbs (only) on the first docker-compose up
## Hosts and reverse proxy ## Hosts and reverse proxy
add to your /etc/hosts : add to your /etc/hosts :
``` ```
127.0.0.1 dev.epau.fr 127.0.0.1 dev.mathallo.fr
127.0.0.1 dev.phpmyadmin.epau.fr 127.0.0.1 dev.phpmyadmin.mathallo.fr
``` ```
configure your vhosts to add a reverse proxy that will redirect the dev.materio.com to our container configure your vhosts to add a reverse proxy that will redirect the dev.materio.com to our container
### nginx ### nginx
```sh ```sh
sudo mkdir /etc/var/log/epau sudo mkdir /etc/var/log/mathallo
``` ```
```nginx ```nginx
server { server {
listen 80; listen 80;
server_name dev.epau.fr; server_name dev.mathallo.fr;
access_log off; access_log off;
error_log /var/log/nginx/epau/error.log error; error_log /var/log/nginx/mathallo/error.log error;
client_max_body_size 100m; client_max_body_size 100m;
@@ -86,7 +86,7 @@ server {
} }
server { server {
listen 80; listen 80;
server_name dev.phpmyadmin.epau.fr; server_name dev.phpmyadmin.mathallo.fr;
location / { location / {
proxy_pass http://127.0.0.1:8981; proxy_pass http://127.0.0.1:8981;
@@ -104,7 +104,7 @@ server {
### apache ### apache
```apache ```apache
<Virtualhost *:80> <Virtualhost *:80>
ServerName dev.epau.fr ServerName dev.mathallo.fr
ProxyPass / http://127.0.0.1:8980/ ProxyPass / http://127.0.0.1:8980/
ProxyPassReverse / http://127.0.0.1:8980/ ProxyPassReverse / http://127.0.0.1:8980/
ProxyRequests Off ProxyRequests Off
@@ -114,7 +114,7 @@ server {
proxy_busy_buffers_size 256k; proxy_busy_buffers_size 256k;
</Virtualhost> </Virtualhost>
<Virtualhost *:80> <Virtualhost *:80>
ServerName dev.phpmyadmin.epau.fr ServerName dev.phpmyadmin.mathallo.fr
ProxyPass / http://127.0.0.1:8981/ ProxyPass / http://127.0.0.1:8981/
ProxyPassReverse / http://127.0.0.1:8981/ ProxyPassReverse / http://127.0.0.1:8981/
ProxyRequests Off ProxyRequests Off
@@ -165,7 +165,7 @@ make composer_install
``` ```
## Visualize ## Visualize
You can now visit http://dev.epau.fr on your browser You can now visit http://dev.mathallo.fr on your browser
After the first run After the first run
## Coding ## Coding
@@ -190,7 +190,7 @@ make maj_config
## Updating manualy the mysql db ## Updating manualy the mysql db
copy your db backup into the mysql container copy your db backup into the mysql container
```sh ```sh
docker cp your-db-file.sql epau-mysql-1:/root/ docker cp your-db-file.sql mathallo-mysql-1:/root/
``` ```
log into mysql container log into mysql container
```sh ```sh
@@ -198,11 +198,11 @@ make exec_mysql
``` ```
once inside the mysql container you can use mysql command to drop then create and load the db with your file once inside the mysql container you can use mysql command to drop then create and load the db with your file
``` ```
mysql -uroot -pepau mysql -uroot -pmathallo
> drop database epau; > drop database mathallo;
> create database epau; > create database mathallo;
> exit; > exit;
mysql -uroot -pepau epau < your-db-file-name.sql mysql -uroot -pmathallo mathallo < your-db-file-name.sql
``` ```
@@ -250,28 +250,28 @@ ps:
logs: logs:
docker-compose logs -f docker-compose logs -f
maj_config: crd composer_install updb cim cr pag #dev.phpmyadmin.epau.fr maj_config: crd composer_install updb cim cr pag #dev.phpmyadmin.mathallo.fr
crd: crd:
docker exec epau-php-1 /bin/bash -c "drush cache-clear drush" docker exec mathallo-php-1 /bin/bash -c "drush cache-clear drush"
composer_install: composer_install:
docker exec epau-php-1 /bin/bash -c "composer install --no-dev" docker exec mathallo-php-1 /bin/bash -c "composer install --no-dev"
updb: updb:
docker exec epau-php-1 /bin/bash -c "drush updb -y" docker exec mathallo-php-1 /bin/bash -c "drush updb -y"
cim: cim:
docker exec epau-php-1 /bin/bash -c "drush config-import -y" docker exec mathallo-php-1 /bin/bash -c "drush config-import -y"
# sync_struct: # sync_struct:
# docker exec epau-php-1 /bin/bash -c "drush im --choice safe && drush ib --choice full" # docker exec mathallo-php-1 /bin/bash -c "drush im --choice safe && drush ib --choice full"
cr: cr:
docker exec epau-php-1 /bin/bash -c "drush cr" docker exec mathallo-php-1 /bin/bash -c "drush cr"
pag: pag:
docker exec epau-php-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term" docker exec mathallo-php-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term"
restart_nginx: restart_nginx:
docker-compose restart nginx docker-compose restart nginx
@@ -283,16 +283,16 @@ down:
docker-compose down docker-compose down
exec_nginx: exec_nginx:
docker exec -it epau-nginx-1 bash docker exec -it mathallo-nginx-1 bash
exec_php: exec_php:
docker exec -it epau-php-1 bash docker exec -it mathallo-php-1 bash
exec_mysql: exec_mysql:
docker exec -it epau-mysql-1 bash docker exec -it mathallo-mysql-1 bash
dump_db: dump_db:
docker exec epau-mysql-1 sh -c 'exec mysqldump -uroot -pepau epau' > ./ressources/epau-$(DATE_NOW)-local.sql docker exec mathallo-mysql-1 sh -c 'exec mysqldump -uroot -pmathallo mathallo' > ./ressources/mathallo-$(DATE_NOW)-local.sql
``` ```

80
docker-compose.yml Normal file
View File

@@ -0,0 +1,80 @@
services:
mysql:
image: mariadb:latest
volumes:
- db-data:/var/lib/mysql
- ./Docker/mysql/mysql.cnf:/etc/mysql/conf.d/custom.cnf:ro
- "${DB_IMPORTE_FILE}:/docker-entrypoint-initdb.d/mathallo.sql"
networks:
- database
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
redis:
image: redis:6
volumes:
- redis-data:/data
networks:
- redis
ports:
- "6379"
php:
build: ./Docker/php-8.3-fpm/
user: ${USER_UID}:${USER_GID}
volumes:
- php-user-data:/home/${USER_UNAME}
- "${PROJECT_ROOT}:/var/www/mathallo"
- "${LOG_ROOT}/php:/var/log:rw"
- "${XDEBUG_INI}:/usr/local/etc/php/conf.d/xdebug.ini"
working_dir: "/var/www/mathallo/"
networks:
- database
- redis
- server
# for xdebug
# https://github.com/docker/for-linux/issues/264#issuecomment-965465879
extra_hosts:
- host.docker.internal:host-gateway
depends_on:
- mysql
- redis
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- 8981:80
networks:
- database
depends_on:
- mysql
environment:
PMA_HOSTS: mysql
nginx:
build: ./Docker/nginx/
ports:
- 8980:80
working_dir: "/var/www"
volumes:
- "${PROJECT_ROOT}:/var/www/mathallo"
- "${LOG_ROOT}:/var/log:rw"
networks:
- server
depends_on:
- php
volumes:
db-data:
redis-data:
php-user-data:
networks:
database:
redis:
server:

View File

@@ -29,11 +29,7 @@
* It is strongly recommended that you set zend.assertions=1 in the PHP.ini file * It is strongly recommended that you set zend.assertions=1 in the PHP.ini file
* (It cannot be changed from .htaccess or runtime) on development machines and * (It cannot be changed from .htaccess or runtime) on development machines and
* to 0 or -1 in production. * to 0 or -1 in production.
*
* @see https://wiki.php.net/rfc/expectations
*/ */
assert_options(ASSERT_ACTIVE, TRUE);
assert_options(ASSERT_EXCEPTION, TRUE);
/** /**
* Enable local development services. * Enable local development services.

View File

@@ -893,9 +893,9 @@ $settings['migrate_node_migrate_type_classic'] = FALSE;
# include $app_root . '/' . $site_path . '/settings.local.php'; # include $app_root . '/' . $site_path . '/settings.local.php';
# } # }
$databases['default']['default'] = array ( $databases['default']['default'] = array (
'database' => 'epau', 'database' => 'mathallo',
'username' => 'root', 'username' => 'root',
'password' => 'epau', 'password' => 'mathallo',
'prefix' => '', 'prefix' => '',
'host' => 'mysql', 'host' => 'mysql',
'port' => '3306', 'port' => '3306',

2
src

Submodule src updated: acd6447b6d...11a9c33e26