├── .gitignore ├── .github ├── dependabot.yaml └── workflows │ └── build-and-push.yaml ├── README.md ├── php7.4 └── Dockerfile ├── php8.1 └── Dockerfile ├── php8.2 └── Dockerfile ├── php8.0 └── Dockerfile └── php-custom.ini /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-wordpress 2 | Docker image for Outlandish WordPress projects 3 | 4 | ## CI builds 5 | 6 | We use GitHub Actions to build and push to Docker Hub daily and on changes to 7 | the `main` branch. 8 | 9 | See [the docs](https://github.com/marketplace/actions/build-and-push-docker-images?version=v2.7.0) 10 | for more on how and why CI and Dependabot are configured within `.github`. 11 | -------------------------------------------------------------------------------- /php7.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.4-fpm-alpine3.13 2 | 3 | ENV PATH "$PATH:/var/www/html/vendor/bin" 4 | 5 | ENV PHP_GD_DEPS "freetype-dev libjpeg-turbo-dev libpng-dev" 6 | 7 | # Set up PHP with modules and ini settings for running WordPress 8 | RUN apk update \ 9 | && apk add --no-cache $PHP_GD_DEPS icu-dev \ 10 | && docker-php-ext-configure intl \ 11 | && docker-php-ext-install gd mysqli pdo pdo_mysql intl \ 12 | && docker-php-ext-enable opcache 13 | 14 | COPY ../php-custom.ini /usr/local/etc/php/ 15 | 16 | RUN apk update && apk add --virtual --no-cache \ 17 | imagemagick imagemagick-dev $PHPIZE_DEPS \ 18 | && pecl install imagick \ 19 | && docker-php-ext-enable imagick \ 20 | && apk del imagemagick-dev $PHPIZE_DEPS 21 | -------------------------------------------------------------------------------- /php8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.1-fpm-alpine3.15 2 | 3 | ENV PATH "$PATH:/var/www/html/vendor/bin" 4 | 5 | ENV PHP_GD_DEPS "freetype-dev libjpeg-turbo-dev libpng-dev" 6 | 7 | # Set up PHP with modules and ini settings for running WordPress 8 | RUN apk update \ 9 | && apk add --no-cache $PHP_GD_DEPS icu-dev \ 10 | && docker-php-ext-configure intl \ 11 | && docker-php-ext-install gd mysqli pdo pdo_mysql intl \ 12 | && docker-php-ext-enable opcache 13 | 14 | COPY ../php-custom.ini /usr/local/etc/php/ 15 | 16 | RUN apk update && apk add --virtual --no-cache \ 17 | imagemagick imagemagick-dev $PHPIZE_DEPS \ 18 | && pecl install imagick \ 19 | && docker-php-ext-enable imagick \ 20 | && apk del imagemagick-dev $PHPIZE_DEPS 21 | -------------------------------------------------------------------------------- /php8.2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.2-fpm-alpine 2 | 3 | ENV PATH "$PATH:/var/www/html/vendor/bin" 4 | 5 | ENV PHP_GD_DEPS "freetype-dev libjpeg-turbo-dev libpng-dev" 6 | 7 | # Set up PHP with modules and ini settings for running WordPress 8 | RUN apk update \ 9 | && apk add --no-cache $PHP_GD_DEPS icu-dev \ 10 | && docker-php-ext-configure intl \ 11 | && docker-php-ext-install gd mysqli pdo pdo_mysql intl \ 12 | && docker-php-ext-enable opcache 13 | 14 | COPY ../php-custom.ini /usr/local/etc/php/ 15 | 16 | RUN apk update && apk add --virtual --no-cache \ 17 | imagemagick imagemagick-dev $PHPIZE_DEPS \ 18 | && pecl install imagick \ 19 | && docker-php-ext-enable imagick \ 20 | && apk del imagemagick-dev $PHPIZE_DEPS 21 | -------------------------------------------------------------------------------- /php8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.0-fpm-alpine3.13 2 | # Alpine 3.15 upgrades Node to 16. Some downstream bits that use `apk` to add Node are not ready for this yet. 3 | # AND Alpine 3.14 still seems to have runtime permission issues with our GitLab runners? 4 | 5 | ENV PATH "$PATH:/var/www/html/vendor/bin" 6 | 7 | ENV PHP_GD_DEPS "freetype-dev libjpeg-turbo-dev libpng-dev" 8 | 9 | # Set up PHP with modules and ini settings for running WordPress 10 | RUN apk update \ 11 | && apk add --no-cache $PHP_GD_DEPS icu-dev \ 12 | && docker-php-ext-configure intl \ 13 | && docker-php-ext-install gd mysqli pdo pdo_mysql intl \ 14 | && docker-php-ext-enable opcache 15 | 16 | COPY ../php-custom.ini /usr/local/etc/php/ 17 | 18 | RUN apk update && apk add --virtual --no-cache \ 19 | imagemagick imagemagick-dev $PHPIZE_DEPS \ 20 | && pecl install imagick \ 21 | && docker-php-ext-enable imagick \ 22 | && apk del imagemagick-dev $PHPIZE_DEPS 23 | -------------------------------------------------------------------------------- /php-custom.ini: -------------------------------------------------------------------------------- 1 | ; Configuration should be common to all supported PHP versions. 2 | 3 | date.timezone=Europe/London 4 | 5 | session.autostart=0 6 | 7 | post_max_size=16M 8 | upload_max_filesize=16M 9 | 10 | ; See https://secure.php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files 11 | ; and https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html 12 | opcache.max_accelerated_files = 7963 13 | 14 | ; Support very small ECS tasks, but increase slightly from default 128MB. 15 | opcache.memory_consumption = 192 16 | 17 | ; Increase from default 8MB 18 | opcache.interned_strings_buffer = 32 19 | 20 | ; As recommended by https://secure.php.net/manual/en/opcache.installation.php and 21 | ; https://www.scalingphpbook.com/blog/2014/02/14/best-zend-opcache-settings.html 22 | opcache.fast_shutdown = 1 23 | 24 | ; Task definition artifacts are immutable on ECS and cache check time is 0 on local -> may as well make tasks faster 25 | opcache.enable_cli = 1 26 | 27 | ; Note opcache.validate_timestamps = 0 is added for ECS instances by modifications in apps' own deployment 28 | ; Dockerfiles. The below is intended for development only – it re-checks files immediately – and is rendered 29 | ; redundant on ECS by that setting. 30 | opcache.revalidate_freq = 0 31 | 32 | ; ECS deployments' Dockerfiles should set this additional key, but on local 33 | ; it would mean you can't see any changes as you work. 34 | ; opcache.validate_timestamps = 0 35 | -------------------------------------------------------------------------------- /.github/workflows/build-and-push.yaml: -------------------------------------------------------------------------------- 1 | name: Build and push to Docker Hub as outlandish/wordpress:latest 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | schedule: 7 | - cron: '17 2 * * *' 8 | 9 | jobs: 10 | build-and-push: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - 14 | name: Set up Docker Buildx 15 | uses: docker/setup-buildx-action@v3 16 | - 17 | name: Login to Docker Hub 18 | uses: docker/login-action@v3 19 | with: 20 | username: ${{ secrets.DOCKERHUB_USERNAME }} 21 | password: ${{ secrets.DOCKERHUB_TOKEN }} 22 | - 23 | name: "Build and push 'latest' (8.1 / default tag)" 24 | id: docker_build_latest 25 | uses: docker/build-push-action@v5 26 | with: 27 | push: true 28 | file: ./php8.1/Dockerfile 29 | tags: outlandish/wordpress:latest 30 | - 31 | name: Build and push php7.4 32 | id: docker_build_php7_4 33 | uses: docker/build-push-action@v5 34 | with: 35 | push: true 36 | file: ./php7.4/Dockerfile 37 | tags: outlandish/wordpress:php7.4 38 | - 39 | name: Build and push php8.0 40 | id: docker_build_php8_0 41 | uses: docker/build-push-action@v5 42 | with: 43 | push: true 44 | file: ./php8.0/Dockerfile 45 | tags: outlandish/wordpress:php8.0 46 | - 47 | name: Build and push php8.1 48 | id: docker_build_php8_1 49 | uses: docker/build-push-action@v5 50 | with: 51 | push: true 52 | file: ./php8.1/Dockerfile 53 | tags: outlandish/wordpress:php8.1 54 | - 55 | name: Build and push php8.2 56 | id: docker_build_php8_2 57 | uses: docker/build-push-action@v5 58 | with: 59 | push: true 60 | file: ./php8.2/Dockerfile 61 | tags: outlandish/wordpress:php8.2 62 | --------------------------------------------------------------------------------