Skip to content

Commit 92bed8e

Browse files
committed
Slim down the base images - most of what was added wasn't needed. If that is needed it can be installed case by case
1 parent 49c4149 commit 92bed8e

2 files changed

Lines changed: 18 additions & 42 deletions

File tree

Dockerfile

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,18 @@ FROM wordpress:${PHP_VERSION}
44

55
ENV XDEBUG_PORT_V2=9000
66
ENV XDEBUG_PORT_V3=9003
7-
ARG PHP_MAJOR_VERSION=8
87

9-
# Install some nice to have dependencies for PHP extensions and developer tools
10-
RUN apt-get update && apt-get install -y \
8+
# Install only essential dependencies for PHP extensions
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
1110
libicu-dev \
12-
libzip-dev \
13-
zlib1g-dev \
14-
libpng-dev \
15-
libjpeg-dev \
16-
libfreetype6-dev \
17-
libxml2-dev \
18-
libssl-dev \
19-
libonig-dev \
20-
vim \
21-
nano \
22-
git \
23-
unzip \
24-
mariadb-client \
25-
msmtp \
2611
&& apt-get clean \
2712
&& rm -rf /var/lib/apt/lists/*
2813

29-
# Install PHP extensions commonly used in WordPress development
30-
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
31-
&& docker-php-ext-install -j$(nproc) \
32-
intl \
33-
mysqli \
34-
pdo_mysql \
35-
zip \
36-
gd \
37-
soap \
38-
bcmath \
39-
exif \
40-
opcache \
14+
# Install only the required PHP extensions: Intl and Redis
15+
RUN docker-php-ext-install intl \
4116
&& pecl install redis \
4217
&& docker-php-ext-enable redis
4318

44-
# Install WP-CLI
45-
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
46-
&& chmod +x wp-cli.phar \
47-
&& mv wp-cli.phar /usr/local/bin/wp
48-
4919
# Install and configure Xdebug
5020
RUN yes | pecl install xdebug && \
5121
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini && \

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# WordPress with Xdebug, Redis and Intl
22

3-
This repository contains Docker images for WordPress with Xdebug, Redis and the PHP Intl extension pre-installed, designed for local development environments.
3+
This repository contains lightweight Docker images for WordPress with Xdebug, Redis and the PHP Intl extension pre-installed, designed for local development environments.
44

55
## Available Tags
66

7-
Images are available for various PHP versions:
7+
Multi-architecture images (amd64, arm64) available for various PHP versions:
88

99
- `pattonwebz/local-wordpress-with-xdebug:php8.0-apache`
1010
- `pattonwebz/local-wordpress-with-xdebug:php8.1-apache`
@@ -21,13 +21,11 @@ Legacy PHP 7 versions are also available but no longer actively maintained:
2121

2222
## Features
2323

24-
- WordPress base images
24+
- Lightweight WordPress base images
2525
- Xdebug pre-installed and configured (Xdebug 2.x for PHP 7, Xdebug 3.x for PHP 8+)
2626
- Redis PHP extension
2727
- PHP Intl extension
28-
- Other useful PHP extensions for WordPress development (gd, mysqli, pdo_mysql, zip, soap, bcmath, exif, opcache)
29-
- WP-CLI pre-installed
30-
- Developer tools (vim, nano, git, unzip, mariadb-client)
28+
- Multi-architecture support (amd64, arm64)
3129

3230
## Usage
3331

@@ -40,19 +38,27 @@ docker run -d -p 8080:80 pattonwebz/local-wordpress-with-xdebug:php8.2-apache
4038
- For PHP 7.x images: Xdebug 2.x is configured on port 9000
4139
- For PHP 8.x images: Xdebug 3.x is configured on port 9003
4240

41+
### Using with Apple Silicon Macs or Raspberry Pi
42+
43+
The images support both amd64 (standard x86_64) and arm64 architectures, making them compatible with Apple Silicon Macs (M1/M2/M3) and Raspberry Pi devices without any special configuration.
44+
4345
## Building the Images
4446

45-
You can build all images locally using the provided `build.sh` script:
47+
You can build images locally using the provided `build.sh` script:
4648

4749
```bash
50+
# Build for your current architecture
4851
./build.sh
52+
53+
# Build multi-architecture images
54+
./build.sh --multi-arch
4955
```
5056

5157
## Automated Builds
5258

5359
Images are automatically built and pushed to Docker Hub using GitHub Actions:
54-
- On pushes to main/master branches
5560
- On the 1st of each month to incorporate security updates
61+
- Manually triggered builds as needed
5662

5763
## License
5864

0 commit comments

Comments
 (0)