Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #806 from jdeathe/centos-7-httpd24u-php72u-develop
Browse files Browse the repository at this point in the history
Release changes for 3.3.3
  • Loading branch information
jdeathe authored Oct 8, 2019
2 parents 1eec7cc + 40a6af4 commit c5c5002
Show file tree
Hide file tree
Showing 17 changed files with 286 additions and 208 deletions.
25 changes: 13 additions & 12 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
.env
.env.example
.git
.gitignore
dist
images
test
docker-compose.yml
LICENSE
README-short.txt
*.md
/.env
/.env.example
/.git
/.gitignore
/dist
/docs
/images
/test
/docker-compose.yml
/LICENSE
/README-short.txt
/*.md
!README.md
**/*.mk
**/Makefile
**/Makefile
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.env
packages
dist
/.env
/dist
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@

Summary of release changes.

### 3.3.3 - 2019-10-08

- Deprecate Makefile target `logs-delayed`; replaced with `logsdef`.
- Updates source image to [2.6.1](https://github.com/jdeathe/centos-ssh/releases/tag/2.6.1).
- Updates `httpd24u` packages to 2.4.41-1.
- Updates `php72u` packages to 7.2.22-1.
- Updates `php72u-pecl-memcached` package to 3.1.3-1.
- Updates `test/health_status` helper script with for consistency.
- Updates Makefile target `logs` to accept `[OPTIONS]` (e.g `make -- logs -ft`).
- Updates info/error output for consistency.
- Updates healthcheck failure messages to remove EOL character that is rendered in status response.
- Updates wrapper script; only emit "waiting on" info message if bootstrap hasn't completed.
- Updates ordering of Tags and respective Dockerfile links in README.md for readability.
- Updates session test cases; replace PHP memcached session store with redis.
- Adds improved test workflow; added `test-setup` target to Makefile.
- Adds Makefile target `logsdef` to handle deferred logs output within a target chain.
- Adds `/docs` directory for supplementary documentation and simplify README.
- Adds test case for Apache `DirectoryIndex` default.
- Adds separate configuration files for Apache and PHP-FPM status paths.
- Fixes missing `/run/php-fpm` path in build and adds fail-safe setup in `php-fpm-wrapper`.
- Fixes validation failure of 0 second --timeout value in `test/health_status`.

### 3.3.2 - 2019-08-03

- Updates php-hello-world to [0.14.0](https://github.com/jdeathe/php-hello-world/releases/tag/0.14.0).
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM jdeathe/centos-ssh:2.6.0
FROM jdeathe/centos-ssh:2.6.1

# Use the form ([{fqdn}-]{package-name}|[{fqdn}-]{provider-name})
ARG PACKAGE_NAME="app"
ARG PACKAGE_PATH="/opt/${PACKAGE_NAME}"
ARG PACKAGE_RELEASE_VERSION="0.14.0"
ARG RELEASE_VERSION="3.3.2"
ARG RELEASE_VERSION="3.3.3"

# ------------------------------------------------------------------------------
# Base install of required packages
Expand All @@ -13,15 +13,15 @@ RUN yum -y install \
--setopt=tsflags=nodocs \
--disableplugin=fastestmirror \
elinks-0.12-0.37.pre6.el7.0.1 \
httpd24u-2.4.39-2.el7.ius \
httpd24u-2.4.41-1.el7.ius \
httpd24u-tools \
httpd24u-mod_ssl \
php72u-cli \
php72u-common-7.2.19-1.el7.ius \
php72u-common-7.2.22-1.el7.ius \
php72u-fpm \
php72u-fpm-httpd \
php72u-opcache \
php72u-pecl-memcached-3.0.4-2.ius.el7 \
php72u-pecl-memcached-3.1.3-1.el7.ius \
php72u-pecl-redis-3.1.6-2.ius.el7 \
&& yum versionlock add \
elinks \
Expand Down Expand Up @@ -52,6 +52,7 @@ ADD src /
# - Disable SSL
# - Add default PHP configuration overrides to 00-php.ini drop-in
# - PHP OPcache configuration
# - Add PHP-FPM run directory
# - PHP-FPM configuration
# - Replace placeholders with values in systemd service unit template
# - Set permissions
Expand Down Expand Up @@ -192,6 +193,8 @@ RUN useradd -r -M -d /var/www/app -s /sbin/nologin app \
-e 's~^;\(opcache.validate_timestamps=\).*$~\10~g' \
/etc/php.d/10-opcache.ini.default \
> /etc/php.d/10-opcache.ini \
&& mkdir -p \
/run/php-fpm \
&& cp -pf \
/etc/php-fpm.conf \
/etc/php-fpm.conf.default \
Expand Down
45 changes: 38 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ Targets:
images Show container's image details.
load Loads from the distribution package. Requires
DOCKER_IMAGE_TAG variable.
logs Display log output from the running container.
logs-delayed Display log output from the running container after
backing off for STARTUP_TIME seconds. This can be
necessary when chaining make targets together.
logs [OPTIONS] Display log output from the container.
logsdef Display log output from the container deferred for
STARTUP_TIME seconds. This will work in a chain
unlike the logs target.
logs-delayed [DEPRECATED] Replaced with logsdef.
pause Pause the running container.
pull Pull the release image from the registry. Requires
the DOCKER_IMAGE_TAG variable.
Expand All @@ -45,6 +46,7 @@ Targets:
stop Stop the container when in a running state.
terminate Unpause, stop and remove the container.
test Run all test cases.
test-setup Install test dependencies.
top [ps OPTIONS] Display the running processes of the container.
unpause Unpause the container when in a paused state.

Expand Down Expand Up @@ -161,6 +163,7 @@ endef
_require-docker-image-tag \
_require-docker-release-tag \
_require-package-path \
_require-root \
_test-prerequisites \
_usage \
all \
Expand All @@ -176,6 +179,7 @@ endef
images \
load \
logs \
logsdef \
logs-delayed \
pause \
pull \
Expand All @@ -191,6 +195,7 @@ endef
stop \
terminate \
test \
test-setup \
top \
unpause

Expand Down Expand Up @@ -365,9 +370,17 @@ _require-package-path:
exit 1; \
fi

_require-root:
@ if [[ $${EUID} -ne 0 ]]; \
then \
>&2 printf -- '%sMust be run as root\n' \
"$(PREFIX_STEP_NEGATIVE)"; \
exit 1; \
fi

_test-prerequisites:
ifeq ($(shpec),)
$(error "Please install shpec.")
$(error "Please install shpec. Try: DOCKER_NAME=$(DOCKER_NAME) make test-setup")
endif

_usage:
Expand Down Expand Up @@ -581,14 +594,20 @@ install: | \
logs: \
_prerequisites \
_require-docker-container
@ $(docker) logs $(DOCKER_NAME)
@ $(docker) logs \
$(filter-out $@, $(MAKECMDGOALS)) \
$(DOCKER_NAME)
%:; @:

logs-delayed: \
logsdef: \
_prerequisites \
_require-docker-container
@ sleep $(STARTUP_TIME)
@ $(MAKE) logs

logs-delayed: \
logsdef

load: \
_prerequisites \
_require-docker-release-tag \
Expand Down Expand Up @@ -980,6 +999,18 @@ test: \
"Functional test"
@ SHPEC_ROOT=$(SHPEC_ROOT) $(shpec)

test-setup: \
_require-root
@ printf -- '%s%s\n' \
"$(PREFIX_STEP)" \
"Installing shpec"
@ bash -c "$$(curl -LSs \
https://raw.githubusercontent.com/rylnd/shpec/master/install.sh \
)"
@ ln -sf \
/usr/local/bin/shpec \
/usr/bin/shpec

unpause: \
_prerequisites \
_require-docker-container \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Tags and respective `Dockerfile` links

- `centos-7-httpd24u-php72u`, `3.3.2` [(centos-7-httpd24u-php72u/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-7-httpd24u-php72u/Dockerfile)
- `centos-6`, `1.13.2` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-6/Dockerfile)
- [`3.3.3`](https://github.com/jdeathe/centos-ssh-apache-php/tree/3.3.3), `centos-7-httpd24u-php72u` [(centos-7-httpd24u-php72u/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-7-httpd24u-php72u/Dockerfile)
- [`1.13.3`](https://github.com/jdeathe/centos-ssh-apache-php/tree/1.13.3), `centos-6` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh-apache-php/blob/centos-6/Dockerfile)

## Overview

Expand All @@ -25,12 +25,12 @@ $ docker run -d \
--name apache-php.1 \
-p 8080:80 \
-e "APACHE_SERVER_NAME=app-1.local" \
jdeathe/centos-ssh-apache-php:3.3.2
jdeathe/centos-ssh-apache-php:3.3.3
```

Go to `http://{{docker-host}}:8080` using a browser where `{{docker-host}}` is the host name of your docker server and, if all went well, you should see the "Hello, world!" page.

![PHP "Hello, world!" - Chrome screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-chrome-v3.3.2.png)
![PHP "Hello, world!" - Chrome screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-chrome-v3.3.3.png)

To be able to access the server using the "app-1.local" domain name you need to add a hosts file entry locally; such that the IP address of the Docker host resolves to the name "app-1.local". Alternatively, you can use the `elinks` browser installed in the container.

Expand All @@ -41,7 +41,7 @@ $ docker exec -it apache-php.1 \
elinks http://app-1.local
```

![PHP "Hello, world!" - eLinks screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-elinks-v3.3.2.png)
![PHP "Hello, world!" - eLinks screenshot](https://raw.github.com/jdeathe/centos-ssh-apache-php/centos-7-httpd24u-php72u/images/php-hello-world-elinks-v3.3.3.png)

Verify the named container's process status and health.

Expand Down Expand Up @@ -91,7 +91,7 @@ $ docker stop apache-php.1 && \
--env "APACHE_SERVER_NAME=app-1.local" \
--env "APACHE_SSL_PROTOCOL=All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1" \
--env "PHP_OPTIONS_DATE_TIMEZONE=Europe/London" \
jdeathe/centos-ssh-apache-php:3.3.2
jdeathe/centos-ssh-apache-php:3.3.3
```

#### Environment Variables
Expand Down Expand Up @@ -205,7 +205,7 @@ $ docker stop apache-php.1 && \
--env "APACHE_SERVER_ALIAS=app-1" \
--env "APACHE_SERVER_NAME=app-1.local" \
--env "APACHE_MOD_SSL_ENABLED=true" \
jdeathe/centos-ssh-apache-php:3.3.2
jdeathe/centos-ssh-apache-php:3.3.3
```

##### APACHE_MPM
Expand Down
13 changes: 13 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Testing

## Functional

The functional test cases are written in [shpec](https://github.com/rylnd/shpec).

To run the tests use the `test` Makefile target after building.

> *Note:* You might need to run via sudo if your environment requires root privileges to run docker.
```
$ make build test
```
15 changes: 15 additions & 0 deletions src/etc/httpd/conf.d/00-php-fpm-status.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<IfModule proxy_module>
<IfModule proxy_fcgi_module>
<Location "/status">
SetHandler "proxy:unix:/run/php-fpm/${APACHE_RUN_USER}.sock|fcgi://localhost"
<IfVersion < 2.4>
Order deny,allow
Deny from all
Allow from localhost 127.0.0.1
</IfVersion>
<IfVersion >= 2.4>
Require host localhost 127.0.0.1
</IfVersion>
</Location>
</IfModule>
</IfModule>
28 changes: 7 additions & 21 deletions src/etc/httpd/conf.d/00-server-status.conf
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
<IfVersion < 2.4>
<Location "/server-status">
SetHandler server-status
<Location "/server-status">
SetHandler server-status
<IfVersion < 2.4>
Order deny,allow
Deny from all
Allow from localhost 127.0.0.1
</Location>
<Location "/status">
SetHandler "proxy:unix:/run/php-fpm/${APACHE_RUN_USER}.sock|fcgi://localhost"
Order deny,allow
Deny from all
Allow from localhost 127.0.0.1
</Location>
</IfVersion>

<IfVersion >= 2.4>
<Location "/server-status">
SetHandler server-status
Require host localhost 127.0.0.1
</Location>
<Location "/status">
SetHandler "proxy:unix:/run/php-fpm/${APACHE_RUN_USER}.sock|fcgi://localhost"
</IfVersion>
<IfVersion >= 2.4>
Require host localhost 127.0.0.1
</Location>
</IfVersion>
</IfVersion>
</Location>
Loading

0 comments on commit c5c5002

Please sign in to comment.