From 88490afe77901da186057d19b36461e427c4bf6a Mon Sep 17 00:00:00 2001 From: Alex Prokopenko Date: Thu, 16 Jul 2020 23:39:44 +0300 Subject: [PATCH] * move hooks to bash * add yml allow dir in storage/app + slow log options for mariadb * nvm fix in workspace build instructions --- {hooks => bash}/enter-to-workspace.sh | 2 +- {hooks => bash}/mysql.sh | 2 +- bash/quit-xdebug.sh | 3 +++ {hooks => bash}/restart-nginx.sh | 2 +- bash/start-xdebug.sh | 3 +++ config/mariadb/slow.cnf | 3 +++ config/nginx/includes.d/octobercms.conf | 1 + dockerfiles/workspace/Dockerfile | 6 +++++- hooks/quit-xdebug.sh | 2 -- hooks/start-xdebug.sh | 2 -- 10 files changed, 18 insertions(+), 8 deletions(-) rename {hooks => bash}/enter-to-workspace.sh (55%) rename {hooks => bash}/mysql.sh (57%) create mode 100755 bash/quit-xdebug.sh rename {hooks => bash}/restart-nginx.sh (54%) create mode 100755 bash/start-xdebug.sh create mode 100644 config/mariadb/slow.cnf delete mode 100755 hooks/quit-xdebug.sh delete mode 100755 hooks/start-xdebug.sh diff --git a/hooks/enter-to-workspace.sh b/bash/enter-to-workspace.sh similarity index 55% rename from hooks/enter-to-workspace.sh rename to bash/enter-to-workspace.sh index f6cd6de..cb51b8a 100755 --- a/hooks/enter-to-workspace.sh +++ b/bash/enter-to-workspace.sh @@ -1,3 +1,3 @@ #!/bin/bash -cd $HOME/docker-compose-projects/structure +cd $HOME/structure docker-compose exec workspace su laradock diff --git a/hooks/mysql.sh b/bash/mysql.sh similarity index 57% rename from hooks/mysql.sh rename to bash/mysql.sh index 7e8340a..b81766d 100755 --- a/hooks/mysql.sh +++ b/bash/mysql.sh @@ -1,3 +1,3 @@ #!/bin/bash -cd $HOME/docker-compose-projects/structure +cd $HOME/structure docker-compose exec db mysql -u root -p123456 diff --git a/bash/quit-xdebug.sh b/bash/quit-xdebug.sh new file mode 100755 index 0000000..8dbb966 --- /dev/null +++ b/bash/quit-xdebug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd $HOME/structure +./dockerfiles/php-fpm/xdebug.sh stop && cd diff --git a/hooks/restart-nginx.sh b/bash/restart-nginx.sh similarity index 54% rename from hooks/restart-nginx.sh rename to bash/restart-nginx.sh index f1239a1..042d9a5 100755 --- a/hooks/restart-nginx.sh +++ b/bash/restart-nginx.sh @@ -1,3 +1,3 @@ #!/bin/bash -cd $HOME/docker-compose-projects/structure +cd $HOME/structure docker-compose exec web nginx -s reload diff --git a/bash/start-xdebug.sh b/bash/start-xdebug.sh new file mode 100755 index 0000000..ba9aaef --- /dev/null +++ b/bash/start-xdebug.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd $HOME/structure +./dockerfiles/php-fpm/xdebug.sh start && cd diff --git a/config/mariadb/slow.cnf b/config/mariadb/slow.cnf new file mode 100644 index 0000000..23bb127 --- /dev/null +++ b/config/mariadb/slow.cnf @@ -0,0 +1,3 @@ +[mariadb] +general_log +general_log_file=/var/log/mariadb/mariadb.log \ No newline at end of file diff --git a/config/nginx/includes.d/octobercms.conf b/config/nginx/includes.d/octobercms.conf index 10dc189..c32bb79 100644 --- a/config/nginx/includes.d/octobercms.conf +++ b/config/nginx/includes.d/octobercms.conf @@ -16,6 +16,7 @@ ## Let nginx return 404 if static file not exists location ~ ^/storage/app/uploads/public { try_files $uri /404; } location ~ ^/storage/app/media { try_files $uri /404; } + location ~ ^/storage/app/yml { try_files $uri /404; } location ~ ^/files { try_files $uri /404; } location ~ ^/storage/app/.*\.xls { try_files $uri /404; } location ~ ^/storage/temp/public { try_files $uri /404; } diff --git a/dockerfiles/workspace/Dockerfile b/dockerfiles/workspace/Dockerfile index d149e2a..61debfb 100644 --- a/dockerfiles/workspace/Dockerfile +++ b/dockerfiles/workspace/Dockerfile @@ -259,6 +259,8 @@ RUN if [ ${INSTALL_FSWATCH} = true ]; then \ # Node / NVM: ########################################################################### +USER laradock + # Check if NVM needs to be installed ARG INSTALL_NODE=false ENV INSTALL_NODE ${INSTALL_NODE} @@ -310,8 +312,10 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ USER root RUN if [ ${INSTALL_NODE} = true ]; then \ + cp -R /home/laradock/.nvm /root/ && \ + chown -R root:root /root/.nvm && \ echo "" >> ~/.bashrc && \ - echo 'export NVM_DIR="/home/laradock/.nvm"' >> ~/.bashrc && \ + echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi diff --git a/hooks/quit-xdebug.sh b/hooks/quit-xdebug.sh deleted file mode 100755 index 4476251..0000000 --- a/hooks/quit-xdebug.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -cd docker-compose-projects/structure/ && ./dockerfiles/php-fpm/xdebug.sh stop && cd diff --git a/hooks/start-xdebug.sh b/hooks/start-xdebug.sh deleted file mode 100755 index e3199c3..0000000 --- a/hooks/start-xdebug.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -cd docker-compose-projects/structure/ && ./dockerfiles/php-fpm/xdebug.sh start && cd