-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.php8.0
More file actions
51 lines (42 loc) · 1.43 KB
/
Copy pathDockerfile.php8.0
File metadata and controls
51 lines (42 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM public.ecr.aws/docker/library/alpine:3.16
ARG WP_VERSION
RUN apk add -u --no-cache \
composer \
curl \
git \
imagemagick \
mysql \
mysql-client \
php8 \
php8-curl \
php8-dom \
php8-exif \
php8-mysqli \
php8-pecl-imagick \
php8-simplexml \
php8-tokenizer \
php8-xml \
php8-xmlwriter
RUN apk add --no-cache php8-pear php8-dev gcc musl-dev make \
&& pecl8 install pcov && echo extension=pcov.so > /etc/php8/conf.d/pcov.ini \
&& apk del php8-pear php8-dev gcc musl-dev make
# Create php symlink to php8
RUN ln -sf /usr/bin/php8 /usr/bin/php
RUN curl -fsSL -o /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \
&& mkdir /wordpress \
&& tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /wordpress \
&& rm /tmp/wordpress.tar.gz
RUN curl -fsSL -o /tmp/wp-phpunit.tar.gz https://github.com/wp-phpunit/wp-phpunit/archive/${WP_VERSION}.0.tar.gz \
&& mkdir /wp-phpunit \
&& tar --strip-components=1 -zxmf /tmp/wp-phpunit.tar.gz -C /wp-phpunit \
&& rm /tmp/wp-phpunit.tar.gz
RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql
RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress"
ENV WP_DEVELOP_DIR=/wp-phpunit
ENV WP_PHPUNIT__TESTS_CONFIG=/wp-tests-config.php
VOLUME ["/code"]
WORKDIR /code
COPY ./docker-entrypoint.sh /entrypoint.sh
COPY ./wp-tests-config.php /wp-tests-config.php
RUN chmod 755 /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]