forked from docker-library/wordpress
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
36 lines (30 loc) · 1.21 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
FROM jamesits/easyphp:latest
LABEL maintainer="[email protected]"
VOLUME /var/www/html
ARG WORDPRESS_VERSION=5.0.3
ARG WORDPRESS_SHA1=F9A4B482288B5BE7A71E9F3DC9B5B0C1F881102B
# upstream tarballs include ./wordpress/ so this gives us /usr/src/wordpress
RUN curl -o wordpress.tar.gz -SL https://wordpress.org/wordpress-${WORDPRESS_VERSION}.tar.gz \
&& echo "$WORDPRESS_SHA1 *wordpress.tar.gz" | sha1sum -c - \
&& tar -xzf wordpress.tar.gz -C /usr/src/ \
&& rm wordpress.tar.gz \
&& chown -R www-data:www-data /usr/src/wordpress
# install wp-cli from https://wp-cli.org/
RUN curl -SLO https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& mkdir -p /usr/src/wp-cli \
&& mv wp-cli.phar /usr/src/wp-cli/ \
&& chmod +x /usr/src/wp-cli/wp-cli.phar
RUN { \
echo '#!/bin/bash'; \
echo 'cd ${WORDPRESS_ROOT:-/var/www/html/}'; \
echo 'exec sudo -u www-data -s -- php /usr/src/wp-cli/wp-cli.phar $@'; \
} > /usr/bin/wp \
&& chmod +x /usr/bin/wp \
&& wp --info
COPY docker-entrypoint.sh /usr/local/bin/
# backwards compat
RUN rm -f /entrypoint.sh \
&& ln -s /usr/local/bin/docker-entrypoint.sh /entrypoint.sh
# ENTRYPOINT resets CMD
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["apache2-foreground"]