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
|
2021-09-22 19:17:20 +02:00
|
|
|
FROM --platform=${TARGETPLATFORM} wordpress:${WP_VERSION}-php${PHP_VERSION}-fpm-alpine AS wordpress-builder
|
2020-03-29 01:42:21 +01:00
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
WORKDIR /tmp/build/rootfs
|
|
|
|
|
|
|
|
# Build root filesystem structure (overlay), and copy over neccessary files
|
|
|
|
RUN mkdir -p usr/local/bin \
|
|
|
|
&& mkdir -p usr/local/etc/php/conf.d/ \
|
|
|
|
&& mv /usr/local/etc/php/conf.d/error-logging.ini usr/local/etc/php/conf.d/ \
|
|
|
|
&& mv /usr/local/etc/php/conf.d/opcache-recommended.ini usr/local/etc/php/conf.d/
|
|
|
|
|
|
|
|
|
|
|
|
################################################# APP ##################################################################
|
2021-09-22 19:17:20 +02:00
|
|
|
FROM --platform=${TARGETPLATFORM} nlss/php-nginx:${PHP_VERSION}
|
2020-06-16 19:13:39 +02:00
|
|
|
ARG WP_VERSION
|
2021-02-09 20:42:24 +01:00
|
|
|
ENV APK_DEPS "zlib-dev libzip-dev libpng-dev icu-dev imagemagick-dev patch"
|
2020-03-29 01:42:21 +01:00
|
|
|
ENV APK_BUILD_DEPS "curl-dev autoconf alpine-sdk"
|
|
|
|
ENV APK_WP_CLI_DEPS "bash less mysql-client"
|
|
|
|
|
|
|
|
RUN apk add --update --no-cache ${APK_WP_CLI_DEPS} ${APK_DEPS} ${APK_BUILD_DEPS} \
|
|
|
|
&& docker-php-ext-install -j "$(nproc)" \
|
|
|
|
bcmath \
|
|
|
|
exif \
|
|
|
|
gd \
|
|
|
|
mysqli \
|
|
|
|
opcache \
|
|
|
|
zip \
|
|
|
|
intl \
|
|
|
|
&& pecl install redis apcu imagick-3.4.4 \
|
|
|
|
&& docker-php-ext-enable redis apcu imagick \
|
|
|
|
&& apk del ${APK_BUILD_DEPS} \
|
|
|
|
&& rm /tmp/* -rf
|
|
|
|
|
|
|
|
COPY --from=wordpress-builder /tmp/build/rootfs /
|
2020-04-02 01:34:34 +02:00
|
|
|
COPY --from=wordpress:cli-php7.4 /usr/local/bin/wp /usr/local/bin/wp-cli
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2021-02-09 20:42:24 +01:00
|
|
|
|
2020-06-16 18:38:47 +02:00
|
|
|
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
|
2020-06-16 18:08:13 +02:00
|
|
|
ENV VIRTUAL_HOST your-domain.com
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2021-02-09 20:42:24 +01:00
|
|
|
ADD rootfs /
|
2021-03-19 13:11:24 +01:00
|
|
|
RUN echo "*/5 * * * * /usr/local/bin/wp cron event run --due-now" >> /etc/crontabs/www-data \
|
2020-06-17 02:45:25 +02:00
|
|
|
&& chmod a+x /usr/local/bin/wp
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2021-02-09 20:42:24 +01:00
|
|
|
VOLUME ["/root/.wp-cli", "/var/www/${WEB_ROOT}", "/var/www/${WEB_ROOT}/wp-content"]
|
2020-03-29 01:42:21 +01:00
|
|
|
|
2020-06-16 19:41:09 +02:00
|
|
|
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS 2
|
2020-06-17 01:37:45 +02:00
|
|
|
ENV ENFORCE_DISABLE_WP_UPDATES true
|
2021-02-09 20:42:24 +01:00
|
|
|
ENV WP_CLI_DISABLE_AUTO_CHECK_UPDATE true
|
|
|
|
|
|
|
|
COPY ["wp-config.php", "/var/www/html"]
|
2020-06-16 19:41:09 +02:00
|
|
|
|
2021-01-11 20:31:23 +01:00
|
|
|
EXPOSE 80/TCP
|