Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bin/dev_command/setup
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ setup() {
fi
}

storage() {
./${DEV_SELF} setup-volumes;
}

php() {
dc php && echo 'PHP configured with version '${DEV_PHP} && return 1;

Expand Down Expand Up @@ -109,6 +113,7 @@ setup() {
suffix;
php;
workspace;
storage;
mysql;

feature RabbitMQ rabbitmq;
Expand Down
17 changes: 17 additions & 0 deletions bin/dev_command/setup-volumes
Original file line number Diff line number Diff line change
@@ -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 $?;
16 changes: 14 additions & 2 deletions bin/dev_command/volume
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 $?;
Expand Down Expand Up @@ -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 $?;
Expand Down
2 changes: 2 additions & 0 deletions build/dist/docker-compose-db8.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion build/dist/docker-compose-elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
volumes:
dockerdev-elasticsearch7-volume:
external: true

services:
elasticsearch6:
build:
Expand All @@ -6,4 +10,3 @@ services:
- FROM_TAG=6.5.4
environment:
- "discovery.type=single-node"

5 changes: 4 additions & 1 deletion build/dist/docker-compose-elasticsearch7.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
volumes:
dockerdev-elasticsearch6-volume:
external: true

services:
elasticsearch7:
build:
Expand All @@ -6,4 +10,3 @@ services:
- FROM_TAG=7.4.2
environment:
- "discovery.type=single-node"

6 changes: 6 additions & 0 deletions build/dist/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 change: 1 addition & 0 deletions build/dist/ssl/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
4 changes: 3 additions & 1 deletion build/dist/web/nginx/content/magento2
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions conf.d/mysql8/my.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mysqld]
log_bin_trust_function_creators = 1