-
Notifications
You must be signed in to change notification settings - Fork 649
/
Dockerfile
executable file
·39 lines (29 loc) · 1.32 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
FROM wordpress
RUN sed -i 's/80/8080/' /etc/apache2/ports.conf /etc/apache2/sites-enabled/000-default.conf
RUN mv "$PHP_INI_DIR"/php.ini-development "$PHP_INI_DIR"/php.ini
# install_wordpress.sh & misc. dependencies
RUN apt-get update; \
apt-get install -yq mariadb-client netcat sudo less git unzip
# wp-cli
RUN curl -sL https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -o wp; \
chmod +x wp; \
mv wp /usr/local/bin/; \
mkdir /var/www/.wp-cli; \
chown www-data:www-data /var/www/.wp-cli
# composer
RUN curl -sL https://raw.githubusercontent.com/composer/getcomposer.org/master/web/installer | php; \
mv composer.phar /usr/local/bin/composer; \
mkdir /var/www/.composer; \
chown www-data:www-data /var/www/.composer
RUN sudo -u www-data composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
# phpunit, phpcs, wpcs
RUN sudo -u www-data composer global require \
phpunit/phpunit \
dealerdirect/phpcodesniffer-composer-installer \
phpcompatibility/phpcompatibility-wp \
automattic/vipwpcs
# ensure wordpress has write permission on linux host https://github.com/postlight/headless-wp-starter/issues/202
RUN chown -R www-data:www-data /var/www/html
# include composer-installed executables in $PATH
ENV PATH="/var/www/.composer/vendor/bin:${PATH}"
EXPOSE 8080