This repository has been archived by the owner on Mar 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
48 lines (41 loc) · 1.42 KB
/
Dockerfile
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
ARG PHP_MAJOR_VERSION=7.4
FROM wordpress:php${PHP_MAJOR_VERSION}
ARG PHP_MAJOR_VERSION
# Install apt dependencies
RUN set -ex; \
apt-get update && apt-get install -qq -y --fix-missing --no-install-recommends \
default-mysql-client \
default-mysql-server; \
apt-get clean; \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* /srv/provision/;
# Install and enable xdebug
RUN set -ex; \
if [ "${PHP_MAJOR_VERSION}" = "7.1" ]; then \
pecl install xdebug-2.9.8; \
elif [ "${PHP_MAJOR_VERSION}" = "7.0" ]; then \
pecl install xdebug-2.6.1; \
elif [ "${PHP_MAJOR_VERSION}" = "5.6" ]; then \
pecl install xdebug-2.5.5; \
else \
pecl install xdebug; \
fi; \
docker-php-ext-enable xdebug;
# Install test harness
COPY wordpress_version.txt /
RUN set -ex; \
curl "https://codeload.github.com/WordPress/wordpress-develop/tar.gz/$(cat /wordpress_version.txt)" -o "/wordpress.tar.gz"; \
mkdir /wordpress; \
tar -xf /wordpress.tar.gz -C /wordpress --strip-components=1; \
rm /wordpress.tar.gz;
# Env vars
ENV WORDPRESS_DB_NAME wordpress
ENV WORDPRESS_DB_USER wordpress
ENV WORDPRESS_DB_PASS password
ENV WORDPRESS_DB_HOST 127.0.0.1
# Configure test harness
COPY ./bin/configure-test-harness.sh /usr/local/bin/
RUN configure-test-harness.sh
# Setup entrypoint
COPY ./bin/entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
WORKDIR /workspace