Skip to content

Commit

Permalink
php-fpm: add php configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxpiper committed Sep 20, 2023
1 parent 06a4588 commit 9e62b1f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion php-fpm-nginx/7.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ushahidi/debian:buster-dockerize
# same minor version
ENV PHP_VERSION=7 \
PHP_MAJOR_VERSION=7.3 \
PHP_MINOR_VERSION=7.3.27 \
PHP_MINOR_VERSION=7.3.33 \
PHP_DOCKER_USH_BUILD_SEQ=1

# Install php, extensions and handy tools
Expand Down Expand Up @@ -42,6 +42,7 @@ RUN apt-get update && \
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
ADD php-fpm.conf ${DOCKERIZE_TEMPLATE_DIR}/etc/php/${PHP_MAJOR_VERSION}/fpm/php-fpm.conf
ADD php-ush.ini ${DOCKERIZE_TEMPLATE_DIR}/etc/php/${PHP_MAJOR_VERSION}/fpm/conf.d/99-ush.ini

# Install composer 1.x and 2.x
RUN curl -sS https://getcomposer.org/installer | \
Expand Down
3 changes: 2 additions & 1 deletion php-fpm-nginx/7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ushahidi/debian:buster-dockerize
# same minor version
ENV PHP_VERSION=7 \
PHP_MAJOR_VERSION=7.4 \
PHP_MINOR_VERSION=7.4.16 \
PHP_MINOR_VERSION=7.4.33 \
PHP_DOCKER_USH_BUILD_SEQ=1

# Install php, extensions and handy tools
Expand Down Expand Up @@ -42,6 +42,7 @@ RUN apt-get update && \
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
ADD php-fpm.conf ${DOCKERIZE_TEMPLATE_DIR}/etc/php/${PHP_MAJOR_VERSION}/fpm/php-fpm.conf
ADD php-ush.ini ${DOCKERIZE_TEMPLATE_DIR}/etc/php/${PHP_MAJOR_VERSION}/fpm/conf.d/99-ush.ini

# Install composer
RUN curl -sS https://getcomposer.org/installer | \
Expand Down
3 changes: 2 additions & 1 deletion php-fpm-nginx/8.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM ushahidi/debian:buster-dockerize
# same minor version
ENV PHP_VERSION=8 \
PHP_MAJOR_VERSION=8.0 \
PHP_MINOR_VERSION=8.0.3 \
PHP_MINOR_VERSION=8.0.29 \
PHP_DOCKER_USH_BUILD_SEQ=1

# Install php, extensions and handy tools
Expand Down Expand Up @@ -42,6 +42,7 @@ RUN apt-get update && \
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
ADD php-fpm.conf ${DOCKERIZE_TEMPLATE_DIR}/etc/php/${PHP_MAJOR_VERSION}/fpm/php-fpm.conf
ADD php-ush.ini ${DOCKERIZE_TEMPLATE_DIR}/etc/php/${PHP_MAJOR_VERSION}/fpm/conf.d/99-ush.ini

# Install composer
RUN curl -sS https://getcomposer.org/installer | \
Expand Down
3 changes: 2 additions & 1 deletion php-fpm-nginx/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ php_config() {
}

start() {
php_config
# DEPRECATED FOR php-ush con.d file
# php_config
# Start the chaperone process
if [[ $UID -eq 0 || $EUID -eq 0 ]]; then
# root
Expand Down
2 changes: 2 additions & 0 deletions php-fpm-nginx/nginx-vhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ server {
charset utf-8;
override_charset on;

client_max_body_size {{ default .Env.PHP_UPLOAD_MAX_FILESIZE "2m" }};

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
Expand Down
6 changes: 6 additions & 0 deletions php-fpm-nginx/php-ush.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[PHP]
post_max_size = {{ default .Env.PHP_POST_MAX_SIZE "8M" }}
upload_max_filesize = {{ default .Env.PHP_UPLOAD_MAX_FILESIZE "2M" }}
memory_limit = {{ default .Env.PHP_MEMORY_LIMIT "128M" }}
max_execution_time = {{ default .Env.PHP_EXEC_TIME_LIMIT "900" }}
max_input_time = {{ default .Env.PHP_MAX_INPUT_TIME "60" }}

0 comments on commit 9e62b1f

Please sign in to comment.