Skip to content

Commit c28dc1f

Browse files
committed
Allow set Wordpress version and php version
1 parent ec09382 commit c28dc1f

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ services:
4242
build:
4343
context: ./docker/wordpress
4444
dockerfile: Dockerfile
45+
args:
46+
- WORDPRESS_VERSION=6
47+
- PHP_VERSION=8.2
4548
depends_on:
4649
- mysql
4750
environment:

docker/wordpress/Dockerfile

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
FROM wordpress:php8.1-fpm-alpine
1+
ARG WORDPRESS_VERSION=6
2+
ARG PHP_VERSION=8.2
3+
4+
FROM wordpress:${WORDPRESS_VERSION}-php${PHP_VERSION}-fpm-alpine
5+
6+
WORKDIR /var/www/html
27

3-
# Install xdebug and Less
48
RUN set -eux; \
5-
apk add --update --no-cache curl less; \
6-
apk add --update --no-cache --virtual .build-deps $PHPIZE_DEPS ; \
9+
\
10+
apk add --update --no-cache --virtual .build-deps \
11+
linux-headers \
12+
$PHPIZE_DEPS \
13+
; \
14+
\
715
pecl update-channels; \
8-
pecl install xdebug; \
16+
pecl install \
17+
xdebug \
18+
; \
919
docker-php-ext-enable xdebug; \
1020
rm -rf /tmp/pear ~/.pearrc; \
21+
\
1122
runDeps="$( \
1223
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
1324
| tr ',' '\n' \
@@ -16,7 +27,13 @@ RUN set -eux; \
1627
)"; \
1728
apk add --update --no-cache --virtual .run-deps $runDeps; \
1829
apk del .build-deps; \
30+
\
1931
php --version
2032

33+
RUN apk add --update --no-cache \
34+
curl \
35+
less \
36+
;
37+
2138
# Install WP-CLI
22-
COPY --from=wordpress:cli-php8.1 /usr/local/bin/wp /usr/local/bin/wp
39+
COPY --from=wordpress:cli-php${PHP_VERSION} /usr/local/bin/wp /usr/local/bin/wp

0 commit comments

Comments
 (0)