-
Notifications
You must be signed in to change notification settings - Fork 865
Expand file tree
/
Copy pathDockerfile
More file actions
87 lines (72 loc) · 2.21 KB
/
Dockerfile
File metadata and controls
87 lines (72 loc) · 2.21 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM ubuntu:xenial
VOLUME ["/var/www/html"]
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Install required Ubuntu packages for having Apache PHP as a module
# as well a bunch of other packages
RUN \
apt-get update \
&& apt-get install -y language-pack-en-base software-properties-common \
&& add-apt-repository ppa:ondrej/php \
&& apt-get update \
&& apt-get install -y \
apache2 \
composer \
curl \
less \
libapache2-mod-php7.3 \
libsodium23 \
mysql-client \
nano \
php-apcu \
php-xdebug \
php7.3 \
php7.3-bcmath \
php7.3-cli \
php7.3-curl \
php7.3-gd \
php7.3-imagick \
php7.3-json \
php7.3-ldap \
php7.3-mbstring \
php7.3-mysql \
php7.3-opcache \
php7.3-pgsql \
php7.3-soap \
php7.3-sqlite3 \
php7.3-xml \
php7.3-xsl \
php7.3-zip \
ssmtp \
subversion \
sudo \
vim \
&& rm -rf /var/lib/apt/lists/*
# Enable mod_rewrite in Apache
RUN a2enmod rewrite
# Install wp-cli
RUN curl -o /usr/local/bin/wp -SL https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar \
&& chmod +x /usr/local/bin/wp
# Install PHPUnit
RUN curl https://phar.phpunit.de/phpunit-7.phar -L -o phpunit.phar \
&& chmod +x phpunit.phar \
&& mv phpunit.phar /usr/local/bin/phpunit
# Copy a default config file for an apache host
COPY ./config/apache_default /etc/apache2/sites-available/000-default.conf
# Copy a default set of settings for PHP (php.ini)
COPY ./config/php.ini /etc/php/7.3/apache2/conf.d/20-jetpack-wordpress.ini
COPY ./config/php.ini /etc/php/7.3/cli/conf.d/20-jetpack-wordpress.ini
# Copy single site htaccess to tmp. run.sh will move it to the site's base dir if there's none present.
COPY ./config/htaccess /tmp/htaccess
COPY ./config/htaccess-multi /tmp/htaccess-multi
# Copy wp-tests-config to tmp. run.sh will move it to the WordPress source code base dir if there's none present.
COPY ./config/wp-tests-config.php /tmp/wp-tests-config.php
# Copy a default set of settings for SMTP.
COPY ./config/ssmtp.conf /etc/ssmtp/ssmtp.conf
# Copy our cmd bash script
COPY ./bin/run.sh /usr/local/bin/run
# Make our cmd script be executable
RUN chmod +x /usr/local/bin/run
# Set the working directory for the next commands
WORKDIR /var/www/html
CMD ["/usr/local/bin/run"]