2023-01-21 03:03:19 +01:00
|
|
|
ARG PHP_VERSION=8.1
|
2022-11-02 21:42:06 +01:00
|
|
|
ARG WP_VERSION=6.1.0
|
2023-08-06 22:25:41 +02:00
|
|
|
ARG WP_PATCH_VERSION=5.9.1
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2023-01-23 22:32:36 +01:00
|
|
|
# WordPress resources
|
2024-10-29 00:37:51 +01:00
|
|
|
FROM wordpress:cli-php${PHP_VERSION} AS wp-cli
|
|
|
|
FROM wordpress:${WP_VERSION}-php${PHP_VERSION}-fpm-alpine AS wp-src
|
2023-01-23 22:32:36 +01:00
|
|
|
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2021-09-25 00:47:50 +02:00
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
# Build rootfs
|
|
|
|
FROM scratch AS rootfs
|
2021-09-25 00:47:50 +02:00
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
# Install wp-cli
|
|
|
|
COPY --from=wp-cli ["/usr/local/bin/wp", "/usr/local/bin/wp-cli"]
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2024-05-19 21:01:52 +02:00
|
|
|
# Install wp-utils
|
|
|
|
COPY ["./src/wp-utils/", "/usr/local/bin/"]
|
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
# Overlay
|
|
|
|
COPY ["./rootfs/", "/"]
|
2021-02-09 20:42:24 +01:00
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
# Configuration and patches
|
2021-09-25 01:11:23 +02:00
|
|
|
ARG WP_VERSION
|
2023-08-06 22:25:41 +02:00
|
|
|
ARG WP_PATCH_VERSION
|
2023-01-23 22:32:36 +01:00
|
|
|
|
2023-01-23 23:03:06 +01:00
|
|
|
# Copy WordPress source from the official image
|
|
|
|
COPY --from=wp-src ["/usr/src/wordpress/", "/var/www/html/"]
|
2023-01-23 22:32:36 +01:00
|
|
|
|
2023-08-06 22:25:41 +02:00
|
|
|
COPY ["patches/${WP_PATCH_VERSION}/wp-admin-update-core.patch", "/etc/wp-mods/"]
|
2022-01-14 23:25:15 +01:00
|
|
|
|
2024-10-29 20:24:06 +01:00
|
|
|
# Copy wp-content/themes to src - This is needed if wp-content is mounted as a volume and not initialized prior
|
|
|
|
COPY --from=wp-src ["/usr/src/wordpress/wp-content/themes/", "/usr/src/wordpress/wp-content/themes/"]
|
|
|
|
|
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
|
|
|
|
# Stage 3 - Final
|
2024-10-29 00:37:51 +01:00
|
|
|
FROM ghcr.io/n0rthernl1ghts/wordpress-unit-base:2.1.0
|
2022-01-14 23:25:15 +01:00
|
|
|
|
2023-01-22 20:07:53 +01:00
|
|
|
RUN apk add --update --no-cache patch
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
COPY --from=rootfs ["/", "/"]
|
2022-01-15 00:05:18 +01:00
|
|
|
|
2023-01-24 01:24:46 +01:00
|
|
|
RUN set -eux \
|
2024-10-29 20:24:06 +01:00
|
|
|
&& apk add --update --no-cache rsync \
|
2023-01-24 01:24:46 +01:00
|
|
|
&& chmod a+x /usr/local/bin/wp \
|
2023-01-24 02:17:20 +01:00
|
|
|
&& mv "/var/www/html/wp-config-docker.php" "/var/www/html/wp-config.php" \
|
2023-01-24 01:24:46 +01:00
|
|
|
&& wp-apply-patch "/etc/wp-mods/wp-admin-update-core.patch" "/var/www/html/wp-admin/update-core.php" "true"
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
ARG WP_VERSION
|
2023-08-06 22:25:41 +02:00
|
|
|
ARG WP_PATCH_VERSION
|
2022-07-26 21:13:53 +02:00
|
|
|
ENV WP_VERSION="${WP_VERSION}"
|
2023-08-06 22:25:41 +02:00
|
|
|
ENV WP_PATCH_VERSION="${WP_PATCH_VERSION}"
|
2022-07-26 21:13:53 +02:00
|
|
|
ENV ENFORCE_DISABLE_WP_UPDATES=true
|
|
|
|
ENV WP_CLI_DISABLE_AUTO_CHECK_UPDATE=true
|
|
|
|
ENV CRON_ENABLED=true
|
2024-05-19 00:26:27 +02:00
|
|
|
ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
|
2021-02-09 20:42:24 +01:00
|
|
|
|
2023-01-23 19:50:30 +01:00
|
|
|
WORKDIR "/var/www/html/"
|
2023-01-23 23:03:06 +01:00
|
|
|
VOLUME ["/root/.wp-cli", "/var/www/html/wp-content"]
|
2020-06-16 19:41:09 +02:00
|
|
|
|
2023-04-06 03:30:03 +02:00
|
|
|
LABEL maintainer="Aleksandar Puharic <aleksandar@puharic.com>" \
|
|
|
|
org.opencontainers.image.documentation="https://github.com/N0rthernL1ghts/wordpress/wiki" \
|
|
|
|
org.opencontainers.image.source="https://github.com/N0rthernL1ghts/wordpress" \
|
2023-08-29 00:38:00 +02:00
|
|
|
org.opencontainers.image.description="NGINX Unit Powered WordPress ${WP_VERSION} - Build ${TARGETPLATFORM}" \
|
2023-04-06 03:30:03 +02:00
|
|
|
org.opencontainers.image.licenses="MIT" \
|
|
|
|
org.opencontainers.image.version="${WP_VERSION}"
|
|
|
|
|
|
|
|
|
2022-01-14 23:25:15 +01:00
|
|
|
ENTRYPOINT ["/init"]
|
2021-01-11 20:31:23 +01:00
|
|
|
EXPOSE 80/TCP
|