wordpress/Dockerfile

51 lines
1.7 KiB
Docker
Raw Normal View History

2021-09-22 18:53:18 +02:00
ARG PHP_VERSION=7.4
2021-09-01 21:03:25 +02:00
ARG WP_VERSION=5.8.0
2020-03-29 01:42:21 +01:00
# Stage 1 - wordpress
FROM --platform=${TARGETPLATFORM} wordpress:${WP_VERSION}-php${PHP_VERSION}-fpm-alpine AS wordpress
# Stage 2 - Build rootfs
FROM scratch AS wordpress-rootfs
2020-03-29 01:42:21 +01:00
COPY --from=wordpress /usr/local/etc/php/conf.d /usr/local/etc/php/conf.d/
COPY --from=wordpress /usr/local/etc/php-fpm.d /usr/local/etc/php-fpm.d/
COPY --from=wordpress /usr/local/include/php/ext /usr/local/include/php/ext/
COPY --from=wordpress /usr/local/lib/php/extensions /usr/local/lib/php/extensions/
COPY --from=wordpress /usr/local/lib/php/test /usr/local/lib/php/test/
2020-03-29 01:42:21 +01:00
# Stage 3 - Final
2021-09-22 19:17:20 +02:00
FROM --platform=${TARGETPLATFORM} nlss/php-nginx:${PHP_VERSION}
# As long as new version doesn't require changes to Dockerfile, we don't need separate files
ENV APK_RUNTIME_DEPS "zlib-dev libzip-dev libpng-dev icu-dev imagemagick-dev patch"
ENV APK_WP_CLI_DEPS "bash less mysql-client"
RUN apk add --update --no-cache ${APK_WP_CLI_DEPS} ${APK_RUNTIME_DEPS}
2020-03-29 01:42:21 +01:00
COPY --from=wordpress-rootfs / /
COPY --from=wordpress:cli-php7.4 /usr/local/bin/wp /usr/local/bin/wp-cli
ARG WP_VERSION
ENV WP_VERSION ${WP_VERSION}
2020-03-29 01:47:01 +01:00
ENV WP_LOCALE en_US
2020-03-29 01:42:21 +01:00
ENV CRON_ENABLED true
ENV VIRTUAL_HOST your-domain.com
2020-03-29 01:42:21 +01:00
ADD rootfs /
RUN echo "*/5 * * * * /usr/local/bin/wp cron event run --due-now" >> /etc/crontabs/www-data \
&& chmod a+x /usr/local/bin/wp
2020-03-29 01:42:21 +01:00
VOLUME ["/root/.wp-cli", "/var/www/${WEB_ROOT}", "/var/www/${WEB_ROOT}/wp-content"]
2020-03-29 01:42:21 +01:00
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
2020-06-17 01:37:45 +02:00
ENV ENFORCE_DISABLE_WP_UPDATES true
ENV WP_CLI_DISABLE_AUTO_CHECK_UPDATE true
COPY ["wp-config.php", "/var/www/html"]
COPY ["patches/${WP_VERSION}/wp-admin-update-core.patch", "/etc/wp-mods/wp-admin/update-core.php.patch"]
2021-01-11 20:31:23 +01:00
EXPOSE 80/TCP