This repository has been archived by the owner on Sep 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
75 lines (55 loc) · 3.09 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
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
FROM php:7-apache
RUN a2enmod rewrite expires
# install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev mysql-client unzip git libcurl4-openssl-dev && rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mysqli opcache curl
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
COPY etc/apache-vhost.conf /etc/apache2/sites-enabled/000-default.conf
RUN mkdir -p /app
COPY etc/composer.json /app/
WORKDIR /app
RUN curl -o /tmp/composer.phar http://getcomposer.org/composer.phar \
&& mv /tmp/composer.phar /usr/local/bin/composer && chmod a+x /usr/local/bin/composer
RUN composer install
RUN cp -rT plugins/ wordpress/wp-content/plugins/
RUN curl -o /tmp/markdown.zip https://littoral.michelf.ca/code/php-markdown/php-markdown-extra-1.2.8.zip \
&& unzip /tmp/markdown.zip -d /app/wordpress/wp-content/plugins \
&& mv /app/wordpress/wp-content/plugins/PHP\ Markdown\ Extra\ 1.2.8/markdown.php /app/wordpress/wp-content/plugins/ \
&& rm -rf /app/wordpress/wp-content/plugins/PHP\ Markdown\ Extra\ 1.2.8/ \
&& rm -rf /tmp/markdown.zip
#### --- Configure entrypoint ---
COPY bin/entrypoint.sh /entrypoint.sh
COPY bin /app/bin/
COPY www/ /app/wordpress
RUN chmod 755 /app/wordpress/wp-content
RUN mkdir /app/wordpress/wp-content/uploads
# RUN mkdir /app/wordpress/wp-content/cache
RUN chmod 777 /app/wordpress/wp-content/uploads
RUN chmod 777 /app/wordpress/wp-content/cache
RUN chmod -R a+rX /app/wordpress
RUN chown -R www-data:www-data /app/wordpress
#### Replaces old install file with one that goes straight to being installed, and activates the plugins
RUN mv /app/wordpress/wp-admin/install.php /app/wordpress/wp-admin/install_temp_old.php
RUN mv /app/wordpress/wp-admin/install_envs.php /app/wordpress/wp-admin/install.php
#### Configures database automatically on first time running
# RUN curl -k -L localhost
# VOLUME /app/wordpress/wp-content/cache
EXPOSE 80
RUN curl -o /app/wordpress/wp-content/themes/feidernd/fonts/colfaxLight.woff http://mal.uninett.no/uninett-theme/fonts/colfaxLight.woff
RUN curl -o /app/wordpress/wp-content/themes/feidernd/fonts/colfaxMedium.woff http://mal.uninett.no/uninett-theme/fonts/colfaxMedium.woff
RUN curl -o /app/wordpress/wp-content/themes/feidernd/fonts/colfaxRegular.woff http://mal.uninett.no/uninett-theme/fonts/colfaxRegular.woff
RUN curl -o /app/wordpress/wp-content/themes/feidernd/fonts/colfaxThin.woff http://mal.uninett.no/uninett-theme/fonts/colfaxThin.woff
RUN curl -o /app/wordpress/wp-content/themes/feidernd/fonts/colfaxRegularItalic.woff http://mal.uninett.no/uninett-theme/fonts/colfaxRegularItalic.woff
# grr, ENTRYPOINT resets CMD now
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apache2-foreground"]