Skip to content

Commit 188509f

Browse files
committed
Starting support to php8
1 parent f2ad11e commit 188509f

29 files changed

Lines changed: 869 additions & 19 deletions

File tree

7.1-prod/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ RUN adduser -D -u 1337 kool \
2121
# dockerize
2222
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2323
&& mv dockerize /usr/local/bin/dockerize \
24+
# pickle
25+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
26+
&& chmod +x /usr/local/bin/pickle \
2427
# deps
2528
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2629
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -36,8 +39,6 @@ RUN adduser -D -u 1337 kool \
3639
--with-png-dir=/usr/include/ \
3740
--with-jpeg-dir=/usr/include/ \
3841
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
39-
&& pecl install imagick-3.4.4 redis \
40-
&& docker-php-ext-enable imagick redis \
4142
&& docker-php-ext-install -j$(nproc) \
4243
bcmath \
4344
calendar \
@@ -54,6 +55,11 @@ RUN adduser -D -u 1337 kool \
5455
soap \
5556
xml \
5657
zip \
58+
&& pickle install imagick \
59+
&& pickle install redis \
60+
# temporarily disabled
61+
# && docker-php-ext-enable imagick \
62+
&& docker-php-ext-enable redis \
5763
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
5864
# composer
5965
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.1/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ RUN adduser -D -u 1337 kool \
2222
# dockerize
2323
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2424
&& mv dockerize /usr/local/bin/dockerize \
25+
# pickle
26+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
27+
&& chmod +x /usr/local/bin/pickle \
2528
# deps
2629
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2730
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -37,8 +40,6 @@ RUN adduser -D -u 1337 kool \
3740
--with-png-dir=/usr/include/ \
3841
--with-jpeg-dir=/usr/include/ \
3942
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
40-
&& pecl install imagick-3.4.4 redis xdebug \
41-
&& docker-php-ext-enable imagick redis \
4243
&& docker-php-ext-install -j$(nproc) \
4344
bcmath \
4445
calendar \
@@ -54,6 +55,13 @@ RUN adduser -D -u 1337 kool \
5455
soap \
5556
xml \
5657
zip \
58+
&& pickle install imagick \
59+
&& pickle install redis \
60+
# temporarily disabled
61+
# && pickle install xdebug \
62+
# temporarily disabled
63+
# && docker-php-ext-enable imagick \
64+
&& docker-php-ext-enable redis \
5765
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
5866
# composer
5967
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.2-prod/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ RUN adduser -D -u 1337 kool \
2121
# dockerize
2222
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2323
&& mv dockerize /usr/local/bin/dockerize \
24+
# pickle
25+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
26+
&& chmod +x /usr/local/bin/pickle \
2427
# deps
2528
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2629
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -36,8 +39,6 @@ RUN adduser -D -u 1337 kool \
3639
--with-png-dir=/usr/include/ \
3740
--with-jpeg-dir=/usr/include/ \
3841
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
39-
&& pecl install imagick-3.4.4 redis \
40-
&& docker-php-ext-enable imagick redis \
4142
&& docker-php-ext-install -j$(nproc) \
4243
bcmath \
4344
calendar \
@@ -54,6 +55,11 @@ RUN adduser -D -u 1337 kool \
5455
soap \
5556
xml \
5657
zip \
58+
&& pickle install imagick \
59+
&& pickle install redis \
60+
# temporarily disabled
61+
# && docker-php-ext-enable imagick \
62+
&& docker-php-ext-enable redis \
5763
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
5864
# composer
5965
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.2/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ RUN adduser -D -u 1337 kool \
2222
# dockerize
2323
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2424
&& mv dockerize /usr/local/bin/dockerize \
25+
# pickle
26+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
27+
&& chmod +x /usr/local/bin/pickle \
2528
# deps
2629
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2730
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -37,8 +40,6 @@ RUN adduser -D -u 1337 kool \
3740
--with-png-dir=/usr/include/ \
3841
--with-jpeg-dir=/usr/include/ \
3942
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
40-
&& pecl install imagick-3.4.4 redis xdebug \
41-
&& docker-php-ext-enable imagick redis \
4243
&& docker-php-ext-install -j$(nproc) \
4344
bcmath \
4445
calendar \
@@ -54,6 +55,13 @@ RUN adduser -D -u 1337 kool \
5455
soap \
5556
xml \
5657
zip \
58+
&& pickle install imagick \
59+
&& pickle install redis \
60+
# temporarily disabled
61+
# && pickle install xdebug \
62+
# temporarily disabled
63+
# && docker-php-ext-enable imagick \
64+
&& docker-php-ext-enable redis \
5765
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
5866
# composer
5967
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.3-prod/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ RUN adduser -D -u 1337 kool \
2121
# dockerize
2222
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2323
&& mv dockerize /usr/local/bin/dockerize \
24+
# pickle
25+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
26+
&& chmod +x /usr/local/bin/pickle \
2427
# deps
2528
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2629
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -36,8 +39,6 @@ RUN adduser -D -u 1337 kool \
3639
--with-png-dir=/usr/include/ \
3740
--with-jpeg-dir=/usr/include/ \
3841
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
39-
&& pecl install imagick-3.4.4 redis \
40-
&& docker-php-ext-enable imagick redis \
4142
&& docker-php-ext-install -j$(nproc) \
4243
bcmath \
4344
calendar \
@@ -54,6 +55,11 @@ RUN adduser -D -u 1337 kool \
5455
soap \
5556
xml \
5657
zip \
58+
&& pickle install imagick \
59+
&& pickle install redis \
60+
# temporarily disabled
61+
# && docker-php-ext-enable imagick \
62+
&& docker-php-ext-enable redis \
5763
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
5864
# composer
5965
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.3/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ RUN adduser -D -u 1337 kool \
2222
# dockerize
2323
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2424
&& mv dockerize /usr/local/bin/dockerize \
25+
# pickle
26+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
27+
&& chmod +x /usr/local/bin/pickle \
2528
# deps
2629
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2730
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -37,8 +40,6 @@ RUN adduser -D -u 1337 kool \
3740
--with-png-dir=/usr/include/ \
3841
--with-jpeg-dir=/usr/include/ \
3942
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
40-
&& pecl install imagick-3.4.4 redis xdebug \
41-
&& docker-php-ext-enable imagick redis \
4243
&& docker-php-ext-install -j$(nproc) \
4344
bcmath \
4445
calendar \
@@ -54,6 +55,13 @@ RUN adduser -D -u 1337 kool \
5455
soap \
5556
xml \
5657
zip \
58+
&& pickle install imagick \
59+
&& pickle install redis \
60+
# temporarily disabled
61+
# && pickle install xdebug \
62+
# temporarily disabled
63+
# && docker-php-ext-enable imagick \
64+
&& docker-php-ext-enable redis \
5765
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
5866
# composer
5967
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.4-prod/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ RUN adduser -D -u 1337 kool \
2121
# dockerize
2222
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2323
&& mv dockerize /usr/local/bin/dockerize \
24+
# pickle
25+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
26+
&& chmod +x /usr/local/bin/pickle \
2427
# deps
2528
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2629
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -33,8 +36,6 @@ RUN adduser -D -u 1337 kool \
3336
# php-ext
3437
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
3538
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
36-
&& pecl install imagick-3.4.4 redis \
37-
&& docker-php-ext-enable imagick redis \
3839
&& docker-php-ext-install -j$(nproc) \
3940
bcmath \
4041
calendar \
@@ -51,6 +52,11 @@ RUN adduser -D -u 1337 kool \
5152
soap \
5253
xml \
5354
zip \
55+
&& pickle install imagick \
56+
&& pickle install redis \
57+
# temporarily disabled
58+
# && docker-php-ext-enable imagick \
59+
&& docker-php-ext-enable redis \
5460
&& cp "/usr/local/etc/php/php.ini-production" "/usr/local/etc/php/php.ini" \
5561
# composer
5662
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

7.4/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ RUN adduser -D -u 1337 kool \
2222
# dockerize
2323
&& curl -L https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-alpine-linux-amd64-v0.6.1.tar.gz | tar xz \
2424
&& mv dockerize /usr/local/bin/dockerize \
25+
# pickle
26+
&& curl -L https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o /usr/local/bin/pickle \
27+
&& chmod +x /usr/local/bin/pickle \
2528
# deps
2629
&& apk --no-cache add su-exec bash sed git openssh-client icu shadow procps \
2730
freetype libpng libjpeg-turbo libzip-dev ghostscript imagemagick \
@@ -34,8 +37,6 @@ RUN adduser -D -u 1337 kool \
3437
# php-ext
3538
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
3639
&& export CFLAGS="$PHP_CFLAGS" CPPFLAGS="$PHP_CPPFLAGS" LDFLAGS="$PHP_LDFLAGS" \
37-
&& pecl install imagick-3.4.4 redis xdebug \
38-
&& docker-php-ext-enable imagick redis \
3940
&& docker-php-ext-install -j$(nproc) \
4041
bcmath \
4142
calendar \
@@ -51,6 +52,13 @@ RUN adduser -D -u 1337 kool \
5152
soap \
5253
xml \
5354
zip \
55+
&& pickle install imagick \
56+
&& pickle install redis \
57+
# temporarily disabled
58+
# && pickle install xdebug \
59+
# temporarily disabled
60+
# && docker-php-ext-enable imagick \
61+
&& docker-php-ext-enable redis \
5462
&& cp "/usr/local/etc/php/php.ini-development" "/usr/local/etc/php/php.ini" \
5563
# composer
5664
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \

8.0-nginx-prod/Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM kooldev/php:8.0-prod
2+
3+
ENV PHP_FPM_LISTEN=/run/php-fpm.sock \
4+
NGINX_LISTEN=80 \
5+
NGINX_ROOT=/app/public \
6+
NGINX_INDEX=index.php \
7+
NGINX_CLIENT_MAX_BODY_SIZE=25M \
8+
NGINX_PHP_FPM=unix:/run/php-fpm.sock \
9+
NGINX_FASTCGI_READ_TIMEOUT=60s \
10+
NGINX_FASTCGI_BUFFERS='8 8k' \
11+
NGINX_FASTCGI_BUFFER_SIZE='16k'
12+
13+
RUN curl -L https://github.com/ochinchina/supervisord/releases/download/v0.6.3/supervisord_static_0.6.3_linux_amd64 -o /usr/local/bin/supervisord \
14+
&& chmod +x /usr/local/bin/supervisord \
15+
&& apk add --no-cache nginx \
16+
&& sed -i "s|^user .*|user\ kool kool;|g" /etc/nginx/nginx.conf \
17+
&& chown -R kool:kool /var/lib/nginx \
18+
&& chmod 770 /var/lib/nginx/tmp \
19+
&& ln -sf /dev/stdout /var/log/nginx/access.log \
20+
&& ln -sf /dev/stderr /var/log/nginx/error.log
21+
22+
COPY supervisor.conf /kool/supervisor.conf
23+
COPY default.tmpl /kool/default.tmpl
24+
25+
EXPOSE 80
26+
27+
ENTRYPOINT [ "dockerize", "-template", "/kool/kool.tmpl:/usr/local/etc/php/conf.d/kool.ini", "-template", "/kool/zz-docker.tmpl:/usr/local/etc/php-fpm.d/zz-docker.conf", "-template", "/kool/default.tmpl:/etc/nginx/conf.d/default.conf", "/kool/entrypoint" ]
28+
CMD [ "supervisord", "-c", "/kool/supervisor.conf" ]

8.0-nginx-prod/default.tmpl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
server {
2+
listen {{ .Env.NGINX_LISTEN }} default_server;
3+
server_name _;
4+
root {{ .Env.NGINX_ROOT }};
5+
index {{ .Env.NGINX_INDEX }};
6+
charset utf-8;
7+
8+
location = /favicon.ico { log_not_found off; access_log off; }
9+
location = /robots.txt { log_not_found off; access_log off; }
10+
11+
client_max_body_size {{ .Env.NGINX_CLIENT_MAX_BODY_SIZE }};
12+
13+
error_page 404 /index.php;
14+
15+
location / {
16+
try_files $uri $uri/ /{{ .Env.NGINX_INDEX }}?$query_string;
17+
18+
add_header X-Served-By kool.dev;
19+
}
20+
21+
location ~ \.php$ {
22+
fastcgi_buffers {{ .Env.NGINX_FASTCGI_BUFFERS }};
23+
fastcgi_buffer_size {{ .Env.NGINX_FASTCGI_BUFFER_SIZE }};
24+
fastcgi_pass {{ .Env.NGINX_PHP_FPM }};
25+
fastcgi_read_timeout {{ .Env.NGINX_FASTCGI_READ_TIMEOUT }};
26+
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
27+
include fastcgi_params;
28+
}
29+
30+
location ~ /\.ht {
31+
deny all;
32+
}
33+
}

0 commit comments

Comments
 (0)