-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdockerfile.ejs
More file actions
51 lines (38 loc) · 2 KB
/
dockerfile.ejs
File metadata and controls
51 lines (38 loc) · 2 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 php:<%= phpVersion %>-apache
RUN apt-get update && apt-get install -y wget rsync libpng-dev libjpeg-dev gnupg default-mysql-client nano less unzip && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd \
&& docker-php-ext-install gd mysqli \
&& pecl install xdebug
COPY config/xdebug.ini /usr/local/etc/php/conf.d
RUN a2enmod rewrite
COPY update.sh <%= workingDir %>/html
ENV PHP_MEMORY_LIMIT=<%= phpMemoryLimit %>
COPY config/php.ini /usr/local/etc/php
COPY config/<%= htaccessFile %> <%= workingDir %>/html/.htaccess
RUN curl -o /bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x /bin/wp \
&& wp --info --allow-root;
RUN curl -sS https://getcomposer.org/installer --output composer-setup.php \
&& php composer-setup.php --version=1.10.16 \
&& mv composer.phar /bin/composer
<% versions.forEach((version) => {
if ( version.match(/(\d+.?)+/) ) {
%>
RUN curl https://wordpress.org/wordpress-<%= version %>.tar.gz > wordpress-<%= version %>.tar.gz && \
mkdir -p <%= workingDir %>/<%= version %> && \
tar -xzf wordpress-<%= version %>.tar.gz -C <%= workingDir %>/<%= version %> && \
mv <%= workingDir %>/<%= version %>/wordpress/* <%= workingDir %>/<%= version %> && \
rm -rf <%= workingDir %>/<%= version %>/wordpress && \
chown -R www-data:www-data <%= workingDir %>/<%= version %><% if (isWpContent) { %> && \<% } else { %>;<% } %>
<% if (isWpContent) { %>rm -rf <%= workingDir %>/<%= version %>/wp-content;<% } %>
<% } else if ( ! volumes.find( (v) => v.includes('/var/www/wordpress') ) ) { %>
ADD <%= version %> /var/www/wordpress
RUN chown -R www-data:www-data /var/www/wordpress
<% } %>
<% }); %>
<% if (vip) { %>
RUN curl https://github.com/Automattic/vip-go-mu-plugins-built/archive/master.zip -L -o /usr/src/vip-mu-plugins.zip && \
unzip /usr/src/vip-mu-plugins.zip -d <%= workingDir %>/html/wp-content && cd <%= workingDir %>/html/wp-content && mv vip-go-mu-plugins-built-master mu-plugins
<% } %>
EXPOSE 80
CMD ["apache2-foreground"]