diff --git a/bash/pm2-logs.sh b/bash/pm2-logs.sh new file mode 100755 index 0000000..6aba725 --- /dev/null +++ b/bash/pm2-logs.sh @@ -0,0 +1,22 @@ +#!/bin/bash +DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" + +. $DIR/bash/_docker-cmd.sh || { + echo "no docker cmd is presented" && exit 1 +} + +PM2_SERVICE=$1 + +if [[ -z "${PM2_SERVICE}" ]]; then + echo "Usage: $(basename $0) NODEJS_PROJECT_NAME" + exit 1 +fi + +CONTAINER=$(docker ps | grep "pm2-${PM2_SERVICE}" | awk '{print $1}') + +if [[ -z "${CONTAINER}" ]]; then + echo "Unable to find container: db" + exit 1 +fi + +$DOCKER_CMD logs --follow ${CONTAINER} \ No newline at end of file diff --git a/bash/show-python-log.sh b/bash/show-python-log.sh new file mode 100755 index 0000000..284a4f7 --- /dev/null +++ b/bash/show-python-log.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker logs --follow $(docker ps | grep "python-${1}" | awk '{print $1}') \ No newline at end of file diff --git a/config/nginx/includes.d/laravel.conf b/config/nginx/includes.d/laravel.conf new file mode 100644 index 0000000..4e7f6e3 --- /dev/null +++ b/config/nginx/includes.d/laravel.conf @@ -0,0 +1,9 @@ +location / { + rewrite ^/.*$ /index.php last; +} + +# Whitelist +location = /favicon.ico { try_files $uri /index.php; } +location ~ ^/.*\.xml { try_files $uri /index.php; } +location = /robots.txt { try_files $uri /index.php; } +location = /humans.txt { try_files $uri /index.php; } diff --git a/config/nginx/includes.d/octobercms.conf b/config/nginx/includes.d/octobercms.conf index eaa5a67..fbb713f 100644 --- a/config/nginx/includes.d/octobercms.conf +++ b/config/nginx/includes.d/octobercms.conf @@ -1,4 +1,11 @@ location / { + if ($request_method = '_OPTIONS') { + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization'; + return 204; + } + rewrite ^/.*$ /index.php last; } location ~ ^/combine.*\.(css|js) { diff --git a/docker-compose.base.yml b/docker-compose.base.yml index 293df7e..f0aa0b7 100755 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -92,7 +92,7 @@ services: - 2500 redis: image: redis - restart: always + restart: unless-stopped command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ] volumes: - ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf @@ -118,6 +118,6 @@ services: pm2: build: context: ./dockerfiles/pm2 - restart: always + restart: unless-stopped expose: - 3000 diff --git a/docker-compose.yml.example b/docker-compose.yml.example index addf4da..36784f3 100755 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -34,6 +34,12 @@ services: service: php build: dockerfile: php83.Dockerfile + php84: + extends: + file: docker-compose.base.yml + service: php + build: + dockerfile: php84.Dockerfile workspace74: extends: file: docker-compose.base.yml @@ -58,6 +64,12 @@ services: service: workspace build: dockerfile: workspace83.Dockerfile + workspace84: + extends: + file: docker-compose.base.yml + service: workspace + build: + dockerfile: workspace84.Dockerfile inbucket: extends: file: docker-compose.base.yml diff --git a/dockerfiles/php-fpm/php84.Dockerfile b/dockerfiles/php-fpm/php84.Dockerfile new file mode 100644 index 0000000..9d4a0ab --- /dev/null +++ b/dockerfiles/php-fpm/php84.Dockerfile @@ -0,0 +1,7 @@ +# syntax = edrevo/dockerfile-plus +FROM dimti/php:8.4 + +ARG PHP_VERSION=8.4 +ENV PHP_VERSION ${PHP_VERSION} + +INCLUDE+ ./php.base.Dockerfile diff --git a/dockerfiles/workspace/workspace84.Dockerfile b/dockerfiles/workspace/workspace84.Dockerfile new file mode 100644 index 0000000..f8912f0 --- /dev/null +++ b/dockerfiles/workspace/workspace84.Dockerfile @@ -0,0 +1,7 @@ +# syntax = edrevo/dockerfile-plus +FROM dimti/workspace:8.4 + +ARG PHP_VERSION=8.4 +ENV PHP_VERSION ${PHP_VERSION} + +INCLUDE+ ./workspace.base.Dockerfile diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 37dded2..6e5a9f5 100755 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -23,6 +23,12 @@ services: service: php-fpm build: dockerfile: fpm/php83.Dockerfile + php84: + extends: + file: docker-compose.base.yml + service: php-fpm + build: + dockerfile: fpm/php84.Dockerfile workspace74: extends: file: docker-compose.base.yml @@ -47,3 +53,9 @@ services: service: workspace build: dockerfile: workspace/workspace83.Dockerfile + workspace84: + extends: + file: docker-compose.base.yml + service: workspace + build: + dockerfile: workspace/workspace84.Dockerfile diff --git a/src/dockerfiles/php/fpm/php84.Dockerfile b/src/dockerfiles/php/fpm/php84.Dockerfile new file mode 100644 index 0000000..25e5d6d --- /dev/null +++ b/src/dockerfiles/php/fpm/php84.Dockerfile @@ -0,0 +1,8 @@ +# syntax = edrevo/dockerfile-plus +FROM php:8.4-fpm + +INCLUDE+ ./fpm/php.base.Dockerfile + +ARG XDEBUG_INI_PATH=/usr/local/etc/php/conf.d/xdebug.ini + +COPY ./xdebug3.ini ${XDEBUG_INI_PATH} diff --git a/src/dockerfiles/php/workspace/workspace.base.Dockerfile b/src/dockerfiles/php/workspace/workspace.base.Dockerfile index 85efc03..1ba32da 100644 --- a/src/dockerfiles/php/workspace/workspace.base.Dockerfile +++ b/src/dockerfiles/php/workspace/workspace.base.Dockerfile @@ -8,7 +8,7 @@ ARG PGID=1000 # For more infromation about set command: See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html # RUN set -xe - +RUN userdel -r ubuntu RUN groupadd -g ${PGID} laradock && \ useradd -u ${PUID} -g laradock -m laradock -G docker_env && \ usermod -p "*" laradock -s /bin/bash diff --git a/src/dockerfiles/php/workspace/workspace84.Dockerfile b/src/dockerfiles/php/workspace/workspace84.Dockerfile new file mode 100644 index 0000000..146473d --- /dev/null +++ b/src/dockerfiles/php/workspace/workspace84.Dockerfile @@ -0,0 +1,9 @@ +# syntax = edrevo/dockerfile-plus +FROM laradock/workspace:latest-8.4 + +ARG PHP_VERSION=8.4 +ENV PHP_VERSION ${PHP_VERSION} + +INCLUDE+ ./workspace/workspace.base.Dockerfile + +INCLUDE+ ./workspace/xdebug3.Dockerfile