Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
dee50f8
Adding temporary _disable and _tail executables for testing
bfren Feb 6, 2021
95338fb
Adding support for sending PHP errors to log file
bfren Feb 6, 2021
47ddb79
Adding additional _disable check
bfren Feb 6, 2021
1d2c5aa
Renaming _tail to _forward
bfren Feb 6, 2021
360a89d
Renaming default PHP error log file
bfren Feb 6, 2021
87a41f3
Add PHP version to default error log file
bfren Feb 6, 2021
b3ce87c
Add log output to log forward service
bfren Feb 6, 2021
09a84f9
Testing log forward sleeping
bfren Feb 6, 2021
7086301
Moving more code to _forward
bfren Feb 6, 2021
1424f51
Test for empty log file and exit _forward when empty
bfren Feb 6, 2021
dfd1561
Updating PHP 7.3 to 7.3.27
bfren Feb 6, 2021
01887b9
Use variable for sleep seconds
bfren Feb 6, 2021
6dd625d
Disable PHP 7.3 on all platforms except AMD/64 temporarily
bfren Feb 6, 2021
fdd5449
Changing _forward test
bfren Feb 6, 2021
6d74bbf
Updating Alpine base image
bfren Feb 7, 2021
a31f48a
Restore all architecture builds
bfren Feb 7, 2021
1ced985
Setting flags and adding documentation comments
bfren Feb 7, 2021
414e8eb
Show error when unsupported PHP_INI value is set
bfren Feb 7, 2021
dcc006d
Handling unset envirionment variables
bfren Feb 7, 2021
88d6691
Adding documentation comment to replace function
bfren Feb 7, 2021
d562c24
Removing test ezxecutables
bfren Feb 7, 2021
9222b64
Adding comments and flags
bfren Feb 7, 2021
aee3753
Adding ignore-favicon.conf to default Nginx configuration
bfren Feb 7, 2021
609fadc
Adding flags and documentation comments
bfren Feb 7, 2021
82626cf
Bumping version to 1.3.0
bfren Feb 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/build_7_3-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -39,8 +39,6 @@ jobs:
file: ./7.3/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
#platforms: linux/amd64,linux/arm/v7
#platforms: linux/amd64,linux/arm64
tags: |
bcgdesign/nginx-php:dev-php-7.3
-
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_7_3-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ jobs:
file: ./7.3/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
#platforms: linux/amd64,linux/arm/v7
#platforms: linux/amd64,linux/arm64
tags: |
bcgdesign/nginx-php:php-7.3
bcgdesign/nginx-php:php-7.3-${{ steps.version.outputs.content }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_7_4-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ jobs:
file: ./7.4/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
#platforms: linux/amd64,linux/arm/v7
#platforms: linux/amd64,linux/arm64
tags: |
bcgdesign/nginx-php:dev-php-7
bcgdesign/nginx-php:dev-php-7.4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_7_4-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ jobs:
file: ./7.4/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
#platforms: linux/amd64,linux/arm/v7
#platforms: linux/amd64,linux/arm64
tags: |
bcgdesign/nginx-php:latest
bcgdesign/nginx-php:${{ steps.version.outputs.content }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_8_0-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ jobs:
file: ./8.0/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
#platforms: linux/amd64,linux/arm/v7
#platforms: linux/amd64,linux/arm64
tags: |
bcgdesign/nginx-php:dev
bcgdesign/nginx-php:dev-php-8
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_8_0-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ jobs:
file: ./8.0/Dockerfile
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
#platforms: linux/amd64,linux/arm/v7
#platforms: linux/amd64,linux/arm64
tags: |
bcgdesign/nginx-php:php-8
bcgdesign/nginx-php:php-8-${{ steps.version.outputs.content }}
Expand Down
3 changes: 2 additions & 1 deletion 7.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bcgdesign/nginx:alpine-3.12-1.2.2
FROM bcgdesign/nginx:alpine-3.12-1.3.0

LABEL maintainer="Ben Green <ben@bcgdesign.com>" \
org.label-schema.name="Nginx + PHP" \
Expand All @@ -10,6 +10,7 @@ ENV PHP_FPM_LOG_LEVEL="notice" \
PHP_INI="production" \
PHP_INI_DISPLAY_ERRORS= \
PHP_INI_DISPLAY_STARTUP_ERRORS= \
PHP_INI_ERROR_LOG="/var/log/php7/error.log" \
PHP_INI_ERROR_REPORTING= \
PHP_INI_MEMORY_LIMIT="256M" \
PHP_INI_MAX_POST="64M" \
Expand Down
2 changes: 1 addition & 1 deletion 7.3/PHP_BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.26-r0
7.3.27-r0
2 changes: 1 addition & 1 deletion 7.3/PHP_REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.3.26
7.3.27
11 changes: 10 additions & 1 deletion 7.3/php-fpm/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/usr/bin/with-contenv bash
_echo "Starting PHP in FPM mode"

set -euo pipefail


#======================================================================================================================
# Start PHP FastCGI Process Manager
# -F run in foreground mode (allows S6 to supervise the service)
#======================================================================================================================

_echo "Starting PHP FastCGI Process Manager"
php-fpm7 -F
3 changes: 2 additions & 1 deletion 7.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bcgdesign/nginx:alpine-3.13-1.2.2
FROM bcgdesign/nginx:alpine-3.13-1.3.0

LABEL maintainer="Ben Green <ben@bcgdesign.com>" \
org.label-schema.name="Nginx + PHP" \
Expand All @@ -10,6 +10,7 @@ ENV PHP_FPM_LOG_LEVEL="notice" \
PHP_INI="production" \
PHP_INI_DISPLAY_ERRORS= \
PHP_INI_DISPLAY_STARTUP_ERRORS= \
PHP_INI_ERROR_LOG="/var/log/php7/error.log" \
PHP_INI_ERROR_REPORTING= \
PHP_INI_MEMORY_LIMIT="256M" \
PHP_INI_MAX_POST="64M" \
Expand Down
11 changes: 10 additions & 1 deletion 7.4/php-fpm/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/usr/bin/with-contenv bash
_echo "Starting PHP in FPM mode"

set -euo pipefail


#======================================================================================================================
# Start PHP FastCGI Process Manager
# -F run in foreground mode (allows S6 to supervise the service)
#======================================================================================================================

_echo "Starting PHP FastCGI Process Manager"
php-fpm7 -F
3 changes: 2 additions & 1 deletion 8.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM bcgdesign/nginx:alpine-3.13-1.2.2
FROM bcgdesign/nginx:alpine-3.13-1.3.0

LABEL maintainer="Ben Green <ben@bcgdesign.com>" \
org.label-schema.name="Nginx + PHP" \
Expand All @@ -10,6 +10,7 @@ ENV PHP_FPM_LOG_LEVEL="notice" \
PHP_INI="production" \
PHP_INI_DISPLAY_ERRORS= \
PHP_INI_DISPLAY_STARTUP_ERRORS= \
PHP_INI_ERROR_LOG="/var/log/php8/error.log" \
PHP_INI_ERROR_REPORTING= \
PHP_INI_MEMORY_LIMIT="256M" \
PHP_INI_MAX_POST="64M" \
Expand Down
11 changes: 10 additions & 1 deletion 8.0/php-fpm/run
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/usr/bin/with-contenv bash
_echo "Starting PHP in FPM mode"

set -euo pipefail


#======================================================================================================================
# Start PHP FastCGI Process Manager
# -F run in foreground mode (allows S6 to supervise the service)
#======================================================================================================================

_echo "Starting PHP FastCGI Process Manager"
php-fpm8 -F
1 change: 1 addition & 0 deletions Dockerfile-automated
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ENV PHP_FPM_LOG_LEVEL="notice" \
PHP_INI="production" \
PHP_INI_DISPLAY_ERRORS= \
PHP_INI_DISPLAY_STARTUP_ERRORS= \
PHP_INI_ERROR_LOG="/var/log/php/error.log" \
PHP_INI_ERROR_REPORTING= \
PHP_INI_MEMORY_LIMIT="256M" \
PHP_INI_MAX_POST="64M" \
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.2
1.3.0
2 changes: 1 addition & 1 deletion overlay/etc/cont-init.d/20-php-fpm-config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _echo "Setting www.conf configuration values..."
declare -A VALUES
VALUES["user"]="www"
VALUES["group"]="www"
VALUES["log_level"]="${PHP_FPM_LOG_LEVEL}"
VALUES["log_level"]="${PHP_FPM_LOG_LEVEL-}"

source /etc/functions/replace.sh
replace VALUES "${PHP_DIR}/php-fpm.d/www.conf"
Expand Down
8 changes: 7 additions & 1 deletion overlay/etc/cont-init.d/21-php-ini-download
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail


#======================================================================================================================
# Get php.ini
# Get php.ini
#======================================================================================================================

DOWNLOADED="${PHP_DIR}/php.ini-${PHP_INI}.downloaded"
Expand All @@ -14,9 +14,15 @@ if [ -e ${DOWNLOADED} ] ; then
fi

if [ "${PHP_INI}" = "development" ] || [ "${PHP_INI}" = "production" ] ; then

URL="https://raw.githubusercontent.com/php/php-src/master/php.ini-${PHP_INI}"
_echo "Downloading php.ini from ${URL}..."
wget -O "${PHP_DIR}/php.ini" ${URL} \
&& touch ${DOWNLOADED}
_done

else

_error "Unsupported PHP_INI value: '${PHP_INI}'."

fi
15 changes: 8 additions & 7 deletions overlay/etc/cont-init.d/22-php-ini-config
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ set -euo pipefail
_echo "Setting php.ini configuration values..."

declare -A VALUES
VALUES["display_errors"]="${PHP_INI_DISPLAY_ERRORS}"
VALUES["display_startup_errors"]="${PHP_INI_DISPLAY_STARTUP_ERRORS}"
VALUES["error_reporting"]="${PHP_INI_ERROR_REPORTING}"
VALUES["memory_limit"]="${PHP_INI_MEMORY_LIMIT}"
VALUES["post_max_size"]="${PHP_INI_MAX_POST}"
VALUES["session.gc_maxlifetime"]="${PHP_SESSION_MAX_LIFETIME}"
VALUES["upload_max_filesize"]="${PHP_INI_MAX_UPLOAD}"
VALUES["display_errors"]="${PHP_INI_DISPLAY_ERRORS-}"
VALUES["display_startup_errors"]="${PHP_INI_DISPLAY_STARTUP_ERRORS-}"
VALUES["error_log"]="${PHP_INI_ERROR_LOG-}"
VALUES["error_reporting"]="${PHP_INI_ERROR_REPORTING-}"
VALUES["memory_limit"]="${PHP_INI_MEMORY_LIMIT-}"
VALUES["post_max_size"]="${PHP_INI_MAX_POST-}"
VALUES["session.gc_maxlifetime"]="${PHP_SESSION_MAX_LIFETIME-}"
VALUES["upload_max_filesize"]="${PHP_INI_MAX_UPLOAD-}"

source /etc/functions/replace.sh
replace VALUES "${PHP_DIR}/php.ini"
Expand Down
8 changes: 8 additions & 0 deletions overlay/etc/functions/replace.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

#======================================================================================================================
# Replace configuration values in a file.
#
# Arguments:
# 1 array of key/value pairs
# 2 path to the configuration file
#======================================================================================================================

replace () {

# get array and file
Expand Down
1 change: 1 addition & 0 deletions overlay/etc/nginx/sites/localhost.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ server {
include helpers/nginx-error-pages.conf;
include helpers/php-try-all.conf;
include helpers/php-try-php.conf;
include helpers/ignore-favicon.conf;
include helpers/static-files.conf;
}
8 changes: 8 additions & 0 deletions overlay/etc/periodic/hourly/php-clean-sessions
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#!/usr/bin/with-contenv bash

set -euo pipefail


#======================================================================================================================
# Call php-clean-sessions executable
#======================================================================================================================

s6-setuidgid www php-clean-sessions
10 changes: 10 additions & 0 deletions overlay/etc/services.d/php-error-log/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bash

set -euo pipefail


#======================================================================================================================
# Forward PHP errors to Docker
#======================================================================================================================

_forward "php-error-log" "${PHP_INI_ERROR_LOG}"
8 changes: 8 additions & 0 deletions overlay/etc/services.d/php-fpm/finish
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
#!/usr/bin/with-contenv bash

set -euo pipefail


#======================================================================================================================
# Use base executable to terminate all services
#======================================================================================================================

_terminate