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 $?; 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 $?; diff --git a/build/dist/docker-compose-db8.yml b/build/dist/docker-compose-db8.yml index 15649af..16a8a1c 100644 --- a/build/dist/docker-compose-db8.yml +++ b/build/dist/docker-compose-db8.yml @@ -1,10 +1,12 @@ volumes: dockerdev-mysql8-volume: + external: true 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/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" - 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; } 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