From 31c8d0e0d897d8516aa0eb0a76f2dc1edac8a5dd Mon Sep 17 00:00:00 2001 From: Anton Komarev Date: Sat, 9 Mar 2024 22:34:02 +0300 Subject: [PATCH] Add Laravel 11 support --- .docker/php74/Dockerfile | 3 +- .docker/php74/www.conf | 85 ---------------------------------------- .docker/php82/Dockerfile | 3 +- .docker/php82/www.conf | 85 ---------------------------------------- composer.json | 12 +++--- docker-compose.yml | 29 +++----------- 6 files changed, 14 insertions(+), 203 deletions(-) delete mode 100644 .docker/php74/www.conf delete mode 100644 .docker/php82/www.conf diff --git a/.docker/php74/Dockerfile b/.docker/php74/Dockerfile index b320c5d..26aa435 100644 --- a/.docker/php74/Dockerfile +++ b/.docker/php74/Dockerfile @@ -1,9 +1,8 @@ # ---------------------- # The FPM base container # ---------------------- -FROM php:7.4-fpm-alpine AS dev +FROM php:7.4-cli-alpine AS dev -# Install build dependencies RUN apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS diff --git a/.docker/php74/www.conf b/.docker/php74/www.conf deleted file mode 100644 index 39bef0c..0000000 --- a/.docker/php74/www.conf +++ /dev/null @@ -1,85 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[www] - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = 9000 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 diff --git a/.docker/php82/Dockerfile b/.docker/php82/Dockerfile index dfb0a5a..1067d5c 100644 --- a/.docker/php82/Dockerfile +++ b/.docker/php82/Dockerfile @@ -1,9 +1,8 @@ # ---------------------- # The FPM base container # ---------------------- -FROM php:8.2-fpm-alpine AS dev +FROM php:8.2-cli-alpine AS dev -# Install build dependencies RUN apk add --no-cache --virtual .build-deps \ $PHPIZE_DEPS diff --git a/.docker/php82/www.conf b/.docker/php82/www.conf deleted file mode 100644 index 39bef0c..0000000 --- a/.docker/php82/www.conf +++ /dev/null @@ -1,85 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[www] - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = www-data -group = www-data - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = 9000 - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 diff --git a/composer.json b/composer.json index 55a20a2..6235501 100644 --- a/composer.json +++ b/composer.json @@ -30,15 +30,15 @@ }, "require": { "php": "^7.4|^8.0", - "illuminate/console": "^8.0|^9.0|^10.1.3", - "illuminate/contracts": "^8.0|^9.0|^10.1.3", - "illuminate/filesystem": "^8.0|^9.0|^10.1.3", - "illuminate/support": "^8.0|^9.0|^10.1.3", + "illuminate/console": "^8.0|^9.0|^10.1.3|^11.0", + "illuminate/contracts": "^8.0|^9.0|^10.1.3|^11.0", + "illuminate/filesystem": "^8.0|^9.0|^10.1.3|^11.0", + "illuminate/support": "^8.0|^9.0|^10.1.3|^11.0", "smi2/phpclickhouse": "^1.4" }, "require-dev": { - "orchestra/testbench": "^7.0|^8.0", - "phpunit/phpunit": "^9.6|^10.0" + "orchestra/testbench": "^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.6|^10.5" }, "autoload": { "psr-4": { diff --git a/docker-compose.yml b/docker-compose.yml index ba1c81c..75406e8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,37 +1,26 @@ version: "3.9" - services: php74: - container_name: laravel-clickhouse-php74 - image: laravel-clickhouse-php74 + container_name: laravel-clickhouse-lib-74 + image: laravel-clickhouse-lib-74 build: context: ./ dockerfile: ./.docker/php74/Dockerfile - restart: unless-stopped - depends_on: - - clickhouse + tty: true working_dir: /app volumes: - ./:/app - - ./.docker/php74/www.conf:/usr/local/etc/php-fpm.d/www.conf:ro - networks: - - laravel-clickhouse php82: - container_name: laravel-clickhouse-php82 - image: laravel-clickhouse-php82 + container_name: laravel-clickhouse-lib-82 + image: laravel-clickhouse-lib-82 build: context: ./ dockerfile: ./.docker/php82/Dockerfile - restart: unless-stopped - depends_on: - - clickhouse + tty: true working_dir: /app volumes: - ./:/app - - ./.docker/php82/www.conf:/usr/local/etc/php-fpm.d/www.conf:ro - networks: - - laravel-clickhouse clickhouse: container_name: laravel-clickhouse-clickhouse @@ -52,13 +41,7 @@ services: ports: - "8123:8123" - "9000:9000" - networks: - - laravel-clickhouse volumes: .docker-volume-clickhouse: driver: local - -networks: - laravel-clickhouse: - driver: bridge