Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion 8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,17 @@ CMD ["sudo", "-E", "php-fpm"]
# one image runs an application without a separate web server service.
FROM php AS apache

# The minimum Apache package version from apache-packages.mk. Its updates are
# what rebuild this variant when Alpine ships a new Apache release.
ARG APACHE_PACKAGE_VERSION

USER root

RUN set -xe; \
apk add --update --no-cache apache2 apache2-proxy; \
test -n "${APACHE_PACKAGE_VERSION}"; \
apk add --update --no-cache \
"apache2>=${APACHE_PACKAGE_VERSION}" \
"apache2-proxy>=${APACHE_PACKAGE_VERSION}"; \
# The image's own configuration replaces Alpine's defaults. \
rm -f /etc/apache2/conf.d/*.conf; \
touch /etc/apache2/vhost.conf; \
Expand Down
12 changes: 8 additions & 4 deletions 8/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ ifneq ($(PHP_WEB),)
$(error PHP_WEB has no development variant)
endif
TARGET := $(PHP_WEB)
# Fail before building when the PHP version has no reviewed Apache package version.
include ../apache-packages.mk
APACHE_PACKAGE_VERSION := $(or $(APACHE_PACKAGE_VERSION_$(PHP_VER_MINOR)),$(error No Apache package version for PHP $(PHP_VER_MINOR); update apache-packages.mk))
APACHE_BUILD_ARGS = --build-arg APACHE_PACKAGE_VERSION=$(APACHE_PACKAGE_VERSION)
else
TARGET := php
endif
Expand Down Expand Up @@ -76,7 +80,7 @@ build:
--build-arg WODBY_USER_ID=$(WODBY_USER_ID) \
--build-arg WODBY_GROUP_ID=$(WODBY_GROUP_ID) \
--target $(TARGET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) $(APACHE_BUILD_ARGS) \
./

build-debug:
Expand All @@ -86,7 +90,7 @@ build-debug:
--build-arg WODBY_USER_ID=$(WODBY_USER_ID) \
--build-arg WODBY_GROUP_ID=$(WODBY_GROUP_ID) \
--target $(TARGET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) $(APACHE_BUILD_ARGS) \
--no-cache --progress=plain ./ 2>&1 | tee build.log

buildx-build:
Expand All @@ -96,7 +100,7 @@ buildx-build:
--build-arg WODBY_USER_ID=$(WODBY_USER_ID) \
--build-arg WODBY_GROUP_ID=$(WODBY_GROUP_ID) \
--target $(TARGET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) $(APACHE_BUILD_ARGS) \
--load \
./

Expand All @@ -107,7 +111,7 @@ buildx-push:
--build-arg WODBY_USER_ID=$(WODBY_USER_ID) \
--build-arg WODBY_GROUP_ID=$(WODBY_GROUP_ID) \
--target $(TARGET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) \
$(PROXY_BUILD_ARGS) $(PIE_BUILD_SECRET) $(APACHE_BUILD_ARGS) \
./

buildx-imagetools-create:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ container, so an application is served without a separate web server container:
- `/.healthz` answers `204`, and the `check-ready` action checks both Apache and PHP-FPM
- Commands other than the default, such as cron jobs or queue workers, run without Apache
- There are no `-dev` variants
- Apache comes from Alpine Linux's `apache2` package. The images are rebuilt when Alpine publishes a newer version

| Variable | Default value | Description |
|----------------------------------------|---------------------------------------------------------|--------------------------------------------------------------------------------|
Expand Down
8 changes: 8 additions & 0 deletions apache-packages.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Minimum Alpine apache2 package version for the -apache variant of each PHP
# version. Updated by wodby/images when Alpine publishes a newer package, so a
# changed line rebuilds the images with that Apache release. Builds install the
# newest available package and fail if the repository offers an older one.
APACHE_PACKAGE_VERSION_8.5 := 2.4.71-r0
APACHE_PACKAGE_VERSION_8.4 := 2.4.71-r0
APACHE_PACKAGE_VERSION_8.3 := 2.4.71-r0
APACHE_PACKAGE_VERSION_8.2 := 2.4.71-r0
Loading