From 784b675b74e7894881e33f881b9840e1ef9d9d9e Mon Sep 17 00:00:00 2001 From: Jerke Combee Date: Fri, 7 Mar 2025 12:08:35 +0100 Subject: [PATCH 1/6] Implement config for db8 to prevent it from running into the log_bin_trust_function_creators error --- build/dist/docker-compose-db8.yml | 1 + conf.d/mysql8/my.cnf | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 conf.d/mysql8/my.cnf diff --git a/build/dist/docker-compose-db8.yml b/build/dist/docker-compose-db8.yml index 15649af..17e7044 100644 --- a/build/dist/docker-compose-db8.yml +++ b/build/dist/docker-compose-db8.yml @@ -5,6 +5,7 @@ services: db8: image: percona:8 volumes: + - ./conf.d/mysql8/my.cnf:/etc/my.cnf.d/development.cnf:ro - dockerdev-mysql8-volume:/var/lib/mysql:rw environment: - MYSQL_ROOT_PASSWORD diff --git a/conf.d/mysql8/my.cnf b/conf.d/mysql8/my.cnf new file mode 100644 index 0000000..2ad036c --- /dev/null +++ b/conf.d/mysql8/my.cnf @@ -0,0 +1,2 @@ +[mysqld] +log_bin_trust_function_creators = 1 From 0f118ca8456c53879f6e6e325f8d6144c8b55332 Mon Sep 17 00:00:00 2001 From: Jerke Combee Date: Fri, 7 Mar 2025 12:27:39 +0100 Subject: [PATCH 2/6] Add more volumes to create --- bin/dev_command/volume | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/dev_command/volume b/bin/dev_command/volume index 8272ffc..d64d7e0 100644 --- a/bin/dev_command/volume +++ b/bin/dev_command/volume @@ -1,9 +1,9 @@ usage() { echo "Usage:"; - echo "- ${DEV_SELF} ${DEV_COMMAND} {workspace|mysql} localpath"; + echo "- ${DEV_SELF} ${DEV_COMMAND} {workspace|mysql|mysql8|elasticsearch6|elasticsearch7} localpath"; echo " create a volume pointing to the localpath"; - echo "- ${DEV_SELF} ${DEV_COMMAND} rm {workspace|mysql}"; + echo "- ${DEV_SELF} ${DEV_COMMAND} rm {workspace|mysql|mysql8|elasticsearch6|elasticsearch7}"; echo " remove a volume"; echo "- ${DEV_SELF} ${DEV_COMMAND} ls"; echo " list current volume mapping" @@ -23,8 +23,14 @@ current() { create() { if [ "$1" == 'mysql' ]; then local VOLUME_TYPE='mysql'; + elif [ "$1" == 'mysql8' ]; then + local VOLUME_TYPE='mysql8'; elif [ "$1" == 'workspace' ]; then local VOLUME_TYPE='workspace'; + elif [ "$1" == 'elasticsearch6' ]; then + local VOLUME_TYPE='elasticsearch6'; + elif [ "$1" == 'elasticsearch7' ]; then + local VOLUME_TYPE='elasticsearch7'; else usage; return $?; @@ -53,8 +59,14 @@ create() { remove() { if [ "$1" == 'mysql' ]; then local VOLUME_TYPE='mysql'; + elif [ "$1" == 'mysql8' ]; then + local VOLUME_TYPE='mysql8'; elif [ "$1" == 'workspace' ]; then local VOLUME_TYPE='workspace'; + elif [ "$1" == 'elasticsearch6' ]; then + local VOLUME_TYPE='elasticsearch6'; + elif [ "$1" == 'elasticsearch7' ]; then + local VOLUME_TYPE='elasticsearch7'; else usage; return $?; From 54d357352f75f21ccf0fc0608341976634c92876 Mon Sep 17 00:00:00 2001 From: Jerke Combee Date: Fri, 7 Mar 2025 12:29:30 +0100 Subject: [PATCH 3/6] Add the external volumes just created in the commands to the yaml files --- build/dist/docker-compose-db8.yml | 1 + build/dist/docker-compose-elasticsearch.yml | 5 ++++- build/dist/docker-compose-elasticsearch7.yml | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build/dist/docker-compose-db8.yml b/build/dist/docker-compose-db8.yml index 17e7044..16a8a1c 100644 --- a/build/dist/docker-compose-db8.yml +++ b/build/dist/docker-compose-db8.yml @@ -1,5 +1,6 @@ volumes: dockerdev-mysql8-volume: + external: true services: db8: diff --git a/build/dist/docker-compose-elasticsearch.yml b/build/dist/docker-compose-elasticsearch.yml index ddf901c..a7ca335 100644 --- a/build/dist/docker-compose-elasticsearch.yml +++ b/build/dist/docker-compose-elasticsearch.yml @@ -1,3 +1,7 @@ +volumes: + dockerdev-elasticsearch7-volume: + external: true + services: elasticsearch6: build: @@ -6,4 +10,3 @@ services: - FROM_TAG=6.5.4 environment: - "discovery.type=single-node" - diff --git a/build/dist/docker-compose-elasticsearch7.yml b/build/dist/docker-compose-elasticsearch7.yml index fb9b1b1..78b1a80 100644 --- a/build/dist/docker-compose-elasticsearch7.yml +++ b/build/dist/docker-compose-elasticsearch7.yml @@ -1,3 +1,7 @@ +volumes: + dockerdev-elasticsearch6-volume: + external: true + services: elasticsearch7: build: @@ -6,4 +10,3 @@ services: - FROM_TAG=7.4.2 environment: - "discovery.type=single-node" - From 973d57a1b67329e10d6478bcb55f7b7ac5a3785c Mon Sep 17 00:00:00 2001 From: Jerke Combee Date: Fri, 7 Mar 2025 14:10:39 +0100 Subject: [PATCH 4/6] Added a script that sets all the required volumes --- bin/dev_command/setup | 5 +++++ bin/dev_command/setup-volumes | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 bin/dev_command/setup-volumes diff --git a/bin/dev_command/setup b/bin/dev_command/setup index 94debf8..d82da63 100644 --- a/bin/dev_command/setup +++ b/bin/dev_command/setup @@ -23,6 +23,10 @@ setup() { fi } + storage() { + ./${DEV_SELF} setup-volumes; + } + php() { dc php && echo 'PHP configured with version '${DEV_PHP} && return 1; @@ -109,6 +113,7 @@ setup() { suffix; php; workspace; + storage; mysql; feature RabbitMQ rabbitmq; diff --git a/bin/dev_command/setup-volumes b/bin/dev_command/setup-volumes new file mode 100644 index 0000000..dda602f --- /dev/null +++ b/bin/dev_command/setup-volumes @@ -0,0 +1,17 @@ +cd $DEV_PATH + +volumes-setup() { + mkdir -p $DEV_WORKSPACE_PATH/.storage/$1; + ./${DEV_SELF} volume $1 $DEV_WORKSPACE_PATH/.storage/$1 > /dev/null; + + return 0; +} + +volumes-setup mysql; +volumes-setup mysql8; +volumes-setup elasticsearch6; +volumes-setup elasticsearch7; + +echo "Created default volumes in $DEV_WORKSPACE_PATH/.storage"; + +return $?; From e08bb5cbef7eed1a3bbd5a676f140de3614cd7f8 Mon Sep 17 00:00:00 2001 From: Jerke Combee Date: Fri, 11 Apr 2025 11:42:35 +0200 Subject: [PATCH 5/6] Add CORS headers and update nginx config to include search.php in order to suport web200/magento-elasticsuite-autocomplete --- build/dist/ssl/nginx/nginx.conf | 1 + build/dist/web/nginx/content/magento2 | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/dist/ssl/nginx/nginx.conf b/build/dist/ssl/nginx/nginx.conf index e914ff4..26acea6 100644 --- a/build/dist/ssl/nginx/nginx.conf +++ b/build/dist/ssl/nginx/nginx.conf @@ -19,6 +19,7 @@ http { proxy_send_timeout 300; proxy_read_timeout 300; + add_header Access-Control-Allow-Origin "*"; types_hash_max_size 2048; log_format docker '[$time_local] - $scheme://$host$uri ' diff --git a/build/dist/web/nginx/content/magento2 b/build/dist/web/nginx/content/magento2 index 1ea3674..540ebb6 100644 --- a/build/dist/web/nginx/content/magento2 +++ b/build/dist/web/nginx/content/magento2 @@ -102,6 +102,8 @@ location /static/ { # Uncomment the following line in production mode # expires max; + add_header Access-Control-Allow-Origin "*"; + # Remove signature of the static files that is used to overcome the browser cache location ~ ^/static/version { rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last; @@ -174,7 +176,7 @@ location /media/import/ { rewrite /pub/health_check.php /health_check.php; # PHP entry point for main application -location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check)\.php$ { +location ~ ^/(index|get|static|errors/report|errors/404|errors/503|health_check|search)\.php$ { try_files .~srcfile @php; } From 7abc4669230fdae12747ebffb9e87c5856c16a26 Mon Sep 17 00:00:00 2001 From: Jerke Date: Thu, 18 Sep 2025 16:29:06 +0200 Subject: [PATCH 6/6] Updated PHP container to contain demanded dependencies --- build/dist/php/Dockerfile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/dist/php/Dockerfile b/build/dist/php/Dockerfile index 0f5a83d..a49a507 100644 --- a/build/dist/php/Dockerfile +++ b/build/dist/php/Dockerfile @@ -10,5 +10,11 @@ ARG UID=1000 RUN groupmod -g $GID app && \ usermod -g $GID -u $UID app +RUN apt-get update && \ + apt-get upgrade --yes && \ + apt-get install --yes rsync + +RUN composer self-update + USER app:app