Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
714f8fd2c9 | ||
|
|
bcd655582e | ||
|
|
3d7812a9ab | ||
|
|
729e4b3316 | ||
|
|
8040225ace |
+4
-1
@@ -9,4 +9,7 @@ solr_data/*
|
||||
var_solr/*
|
||||
ressources/xdebug.ini
|
||||
ressources/*.sql.gz
|
||||
ai-docs/
|
||||
ai-docs/
|
||||
solr_cores_stage/
|
||||
AGENTS.md
|
||||
.vibe/
|
||||
|
||||
+15
-1
@@ -41,6 +41,15 @@ COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
|
||||
# ENTRYPOINT ["sh", "-c", "service rsyslog start ; tail -f /dev/null"]
|
||||
|
||||
COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
|
||||
# Xdebug: off by default on CLI (drush, composer) — mode=debug alone still hooks every
|
||||
# function call and is what makes CLI commands slow, even with start_with_request=trigger.
|
||||
# Use `XDEBUG_MODE=debug XDEBUG_TRIGGER=1 drush ...` (see xdebugon/xdebugoff aliases) to debug a CLI run.
|
||||
# FPM loads an extra ini dir: web debugging stays available (browser XDEBUG_SESSION trigger),
|
||||
# but never tries to connect on its own — start_with_request=yes cost a ~15s connect timeout
|
||||
# on every request served by a cold worker when no IDE listens on 9001.
|
||||
RUN printf "xdebug.mode=off\nxdebug.start_with_request=trigger\n" > /usr/local/etc/php/conf.d/zz-xdebug-cli.ini && \
|
||||
mkdir -p /usr/local/etc/php/fpm-conf.d && \
|
||||
printf "xdebug.mode=debug\nxdebug.start_with_request=trigger\n" > /usr/local/etc/php/fpm-conf.d/zz-xdebug-fpm.ini
|
||||
# COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
|
||||
|
||||
|
||||
@@ -64,6 +73,11 @@ RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
|
||||
COPY ./bashrc /home/${USER_UNAME}/.bashrc
|
||||
COPY ./inputrc /home/${USER_UNAME}/.inputrc
|
||||
|
||||
# /home/${USER_UNAME} is a persistent named volume, so files COPYed there only apply on
|
||||
# first volume creation. Put the xdebug aliases in /etc/bash.bashrc instead, which is part
|
||||
# of the image and always sourced by interactive shells (docker exec, ssh).
|
||||
RUN printf "\n# Xdebug is off by default on CLI for speed (see zz-xdebug-cli.ini).\nalias xdebugon='export XDEBUG_MODE=debug XDEBUG_TRIGGER=1'\nalias xdebugoff='unset XDEBUG_MODE XDEBUG_TRIGGER'\n" >> /etc/bash.bashrc
|
||||
|
||||
# https://github.com/ProgDroid/composer_update_autocomplete
|
||||
RUN mkdir /home/${USER_UNAME}/.bin
|
||||
COPY ./composer_update_autocomplete /home/${USER_UNAME}/.bin/composer_update_autocomplete
|
||||
@@ -82,7 +96,7 @@ EXPOSE 22
|
||||
|
||||
# https://stackoverflow.com/questions/36964652/ssh-in-docker-container-causes-http-404
|
||||
# use \n to make the content into multiple lines
|
||||
RUN printf "whoami\nphp-fpm -D\n/usr/sbin/sshd -D" >> /start.sh
|
||||
RUN printf "whoami\nPHP_INI_SCAN_DIR=/usr/local/etc/php/conf.d:/usr/local/etc/php/fpm-conf.d php-fpm -D\n/usr/sbin/sshd -D" >> /start.sh
|
||||
RUN chmod +x /start.sh
|
||||
CMD ["/start.sh"]
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM solr:8.10
|
||||
FROM solr:8.10.1
|
||||
|
||||
# COPY --chown=solr:solr ./server /opt/solr/server/solr/
|
||||
|
||||
@@ -21,7 +21,7 @@ buildnc:
|
||||
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
|
||||
|
||||
buildsolrnc:
|
||||
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) solr-new
|
||||
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) solr
|
||||
|
||||
buildphp:
|
||||
docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) php
|
||||
@@ -67,7 +67,7 @@ down:
|
||||
docker-compose down
|
||||
|
||||
restart_solr:
|
||||
docker-compose restart solr-new
|
||||
docker-compose restart solr
|
||||
|
||||
restart_redis:
|
||||
docker-compose restart redis
|
||||
@@ -94,7 +94,7 @@ exec_mysql:
|
||||
docker exec -it materiod8-mysql-1 bash
|
||||
|
||||
exec_solr:
|
||||
docker exec -it materiod8-solr-new-1 bash
|
||||
docker exec -it materiod8-solr-1 bash
|
||||
|
||||
exec_solrlegacy:
|
||||
docker exec -it materiod8-solr-legacy-1 bash
|
||||
|
||||
@@ -90,6 +90,30 @@ sudo docker exec -it materiod8_php_1 bash
|
||||
```
|
||||
once inside the php container in /var/www/html you can use drush as usual
|
||||
|
||||
### Xdebug
|
||||
|
||||
Xdebug is installed in the php container, listening for your IDE on `host.docker.internal:9001` (see `ressources/xdebug.ini`, `.vscode/launch.json` in `public_html`).
|
||||
|
||||
Web and CLI behave differently on purpose, because leaving `xdebug.mode=debug` on all the time makes every `drush`/`composer` command noticeably slower (Xdebug hooks every function call as soon as the mode is active, whether or not a debugger actually connects):
|
||||
|
||||
- **Browser requests (php-fpm)**: Xdebug is always on (`xdebug.mode=debug`, `xdebug.start_with_request=yes`). Just start listening in your IDE and load the page, no trigger needed.
|
||||
- **CLI (`drush`, `composer`, ...)**: Xdebug is **off by default** (`xdebug.mode=off`) so commands stay fast. To debug a specific command, turn it on for the current shell first:
|
||||
```
|
||||
xdebugon
|
||||
drush some:command
|
||||
xdebugoff
|
||||
```
|
||||
`xdebugon`/`xdebugoff` are shell aliases defined in `/etc/bash.bashrc` inside the php container (they set/unset `XDEBUG_MODE=debug` and `XDEBUG_TRIGGER=1`). You can also do it inline for a single command:
|
||||
```
|
||||
XDEBUG_MODE=debug XDEBUG_TRIGGER=1 drush some:command
|
||||
```
|
||||
|
||||
This split is implemented as two extra ini files loaded per-SAPI, see `Docker/php/Dockerfile`:
|
||||
- `/usr/local/etc/php/conf.d/zz-xdebug-cli.ini` → loaded by both CLI and php-fpm (default conf.d), sets `xdebug.mode=off`.
|
||||
- `/usr/local/etc/php/fpm-conf.d/zz-xdebug-fpm.ini` → only loaded by php-fpm (via `PHP_INI_SCAN_DIR` in `/start.sh`), overrides back to `xdebug.mode=debug` for web requests.
|
||||
|
||||
If you change any of these files, rebuild the php image (`make buildphp`) and recreate the container (`make up`) — do not use raw `docker-compose up`, it won't pick up `USER_UID`/`USER_GID` and the container will run as root (see Makefile section below).
|
||||
|
||||
### gulp
|
||||
Dev process needs gulp to run in:
|
||||
- public_html/sites/all/modules/custom/materio/
|
||||
|
||||
@@ -1,11 +1,34 @@
|
||||
#! /bin/bash
|
||||
# Régénère la config Solr depuis Drupal (search_api_solr) et l'écrit dans un arbre du dépôt solr_cores,
|
||||
# puis recharge les cores (RELOAD, sans restart).
|
||||
#
|
||||
# bin/update_solr_config.sh -> solr_cores (branche prod, Solr 8, :8985)
|
||||
# bin/update_solr_config.sh solr_cores_stage URL -> worktree stage (Solr 9, phase 2)
|
||||
#
|
||||
# Les modifications restent à relire / committer dans l'arbre visé (git diff).
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.." || exit 1
|
||||
|
||||
TREE=${1:-solr_cores}
|
||||
SOLR=${2:-http://localhost:8985/solr}
|
||||
CORES="materio_base materio_autocomplete"
|
||||
|
||||
[ -d "$TREE/materio_base/conf" ] || { echo "arbre $TREE invalide" >&2; exit 1; }
|
||||
|
||||
docker exec -i materiod8-php-1 drush cdel search_api_solr.solr_field_type.text_edgestring_ascii_und_6_0_0
|
||||
docker exec -i materiod8-php-1 drush cdel search_api_solr.solr_field_type.text_string_ascii_und_6_0_0
|
||||
docker exec -i materiod8-php-1 drush dre materio_sapi
|
||||
docker exec -i materiod8-php-1 drush solr-gsc database_search_autocomplete config.zip
|
||||
mkdir ressources/solr/
|
||||
mv public_html/web/config.zip ressources/solr/
|
||||
unzip -o ressources/solr/config.zip -d var_solr/data/materio/conf
|
||||
unzip -o ressources/solr/config.zip -d var_solr/data/materio_autocomplete/conf
|
||||
docker-compose restart solr-new
|
||||
docker exec -i materiod8-php-1 drush solr-gsc database_search_autocomplete config.zip || exit 1
|
||||
mkdir -p ressources/solr/
|
||||
mv public_html/web/config.zip ressources/solr/ || exit 1
|
||||
|
||||
for core in $CORES; do
|
||||
unzip -o ressources/solr/config.zip -d "$TREE/$core/conf"
|
||||
done
|
||||
|
||||
for core in $CORES; do
|
||||
out=$(curl -s "$SOLR/admin/cores?action=RELOAD&core=$core&wt=json")
|
||||
if echo "$out" | grep -q '"status":0'; then echo "RELOAD $core OK"; else echo "RELOAD $core ÉCHEC : $out" >&2; fi
|
||||
done
|
||||
|
||||
git -C "$TREE" status --short
|
||||
|
||||
+7
-6
@@ -55,19 +55,20 @@ services:
|
||||
# ports:
|
||||
# - "6388"
|
||||
|
||||
solr-new:
|
||||
solr:
|
||||
build: ./Docker/solr/
|
||||
# user: ${USER_UID}:${USER_GID}
|
||||
# même structure que CT-materio (prod) : SOLR_HOME = /var/solr/data (solr.xml + core.properties + index),
|
||||
# configsets = dépôt solr_cores (branche prod), monté en lecture seule (configSetBaseDir dans solr.xml)
|
||||
environment:
|
||||
- SOLR_HOME=/var/solr
|
||||
- SOLR_HOME=/var/solr/data
|
||||
volumes:
|
||||
- ./var_solr:/var/solr
|
||||
- ./var_solr:/var/solr
|
||||
- ./solr_cores:/opt/configsets:ro
|
||||
# - solr-data: /var/solr
|
||||
# - "${SOLR_CORES}:/var/solr/data"
|
||||
# - "${SOLR_DATA}:/var/solr"
|
||||
# - "${SOLR_CORES}:/opt/solr/server/solr"
|
||||
command:
|
||||
- solr-precreate
|
||||
networks:
|
||||
- solr
|
||||
ports:
|
||||
@@ -111,7 +112,7 @@ services:
|
||||
- mysql
|
||||
# - mysql-legacy
|
||||
- redis
|
||||
- solr-new
|
||||
- solr
|
||||
|
||||
# php-legacy:
|
||||
# build: ./Docker/php-legacy/
|
||||
|
||||
+1
-1
Submodule public_html updated: 48c31420a7...5846e0f4d3
+1
-1
Submodule public_html_legacy updated: 49a0944412...374e46e2e3
+1
-1
Submodule solr_cores updated: 3665537182...6ecfbdd621
Reference in New Issue
Block a user