-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (44 loc) · 1.41 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
FROM php:7.1-apache
MAINTAINER Georg Meyer <[email protected]>
# utilities
RUN apt-get update \
&& apt-get install -y build-essential sudo unzip
# node
RUN apt-get update
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - \
&& apt-get install -y nodejs
# mysqli
RUN docker-php-ext-install mysqli
RUN a2enmod rewrite
# Create user account
ENV USERNAME deploy
ENV HOME /home/$USERNAME
RUN adduser --home $HOME --disabled-password --gecos '' $USERNAME
RUN mkdir -p $HOME/.ssh && touch $HOME/.ssh/known_hosts \
&& chown -R deploy:deploy $HOME/.ssh
RUN echo "%$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
RUN usermod -a -G www-data deploy
# Wordpress
WORKDIR /tmp
ENV HTDOCS /var/www/html
ENV WP_VERSION 4.7.5
ENV WP_LANG de
ENV WP_LOCALE de_DE
RUN curl -sSL https://${WP_LANG}.wordpress.org/wordpress-${WP_VERSION}-${WP_LOCALE}.tar.gz | tar xz
RUN rm -rf \
wordpress/wp-content/themes/* \
wordpress/wp-content/plugins/* \
wordpress/readme.html
RUN rm -rf ${HTDOCS}/* \
&& cp -R /tmp/wordpress/* ${HTDOCS}/
RUN rm -rf /tmp/wordpress
# Wordpress plugins
ENV WP_PLUGINS wp-nested-pages.1.7.1 timber-library.1.2.4 regenerate-thumbnails
RUN for PLUGIN in ${WP_PLUGINS}; do \
curl -sSL https://downloads.wordpress.org/plugin/${PLUGIN}.zip > /tmp/${PLUGIN}.zip \
&& unzip -q -o /tmp/${PLUGIN}.zip -d ${HTDOCS}/wp-content/plugins/; \
done
WORKDIR $HOME
# run
USER $USERNAME
CMD ["sudo", "apache2-foreground"]