-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (41 loc) · 1.88 KB
/
Copy pathDockerfile
File metadata and controls
54 lines (41 loc) · 1.88 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
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
# node.js
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN apt-get install -yq nodejs
RUN npm i -g yarn
# 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
# phpunit, phpcs, wpcs
RUN sudo -u www-data composer global require \
phpunit/phpunit \
dealerdirect/phpcodesniffer-composer-installer \
phpcompatibility/phpcompatibility-wp \
automattic/vipwpcs
COPY . /var/www/html/wp-content/themes/presspack/
RUN cd /var/www/html/wp-content/themes/presspack/ && ls -la
RUN cd /var/www/html/wp-content/themes/presspack/ && yarn install
RUN cp /var/www/html/wp-content/themes/presspack/composer.json /var/www/html
RUN cp /var/www/html/wp-content/themes/presspack/composer.lock /var/www/html
RUN mv /var/www/html/wp-content/themes/presspack/plugins /var/www/html/wp-content/plugins
RUN cd /var/www/html && /usr/local/bin/composer install --no-interaction
# 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
RUN chmod -R www-data:www-data 777 /var/www/html
# include composer-installed executables in $PATH
ENV PATH="/var/www/.composer/vendor/bin:${PATH}"
EXPOSE 8080
USER www-data:www-data