-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.debian
53 lines (45 loc) · 2.3 KB
/
Dockerfile.debian
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
ARG WORDPRESS_VERSION=5.2.1-php7.3-apache
FROM wordpress:${WORDPRESS_VERSION}
ARG NEW_RELIC_AGENT_URL='https://download.newrelic.com/php_agent/release/newrelic-php5-9.10.1.263-linux.tar.gz'
ENV NEWRELIC_LICENSE='your-key'
ENV NEWRELIC_APPNAME='your-app'
USER 0
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update -y && \
apt-get install -y bash bash-completion curl python python-pip less mailutils && \
pip install crudini && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ADD entrypoint.sh /usr/local/bin/
RUN chmod a+x /usr/local/bin/entrypoint.sh && \
curl -sS -L ${NEW_RELIC_AGENT_URL} | tar -C /tmp -zx && \
export NR_INSTALL_USE_CP_NOT_LN=1 && \
export NR_INSTALL_SILENT=1 && \
/tmp/newrelic-php5-*/newrelic-install install && \
rm -rf /tmp/newrelic-php5-* /tmp/nrinstall* && \
mv /usr/local/etc/php/conf.d/newrelic.ini /usr/local/etc/php/conf.d/newrelic.ini.template
RUN curl -ss -o /usr/local/bin/wp-cli -O https://gitcdn.link/repo/wp-cli/builds/gh-pages/phar/wp-cli.phar && \
chmod a+x /usr/local/bin/wp-cli
RUN if [ -f /etc/apache2/mods-enabled/status.conf ]; then \
sed -i -e '/Require local/ a \ Require ip 192.168.0.0/16' /etc/apache2/mods-enabled/status.conf; \
sed -i -e '/Require local/ a \ Require ip 172.16.0.0/12' /etc/apache2/mods-enabled/status.conf; \
sed -i -e '/Require local/ a \ Require ip 192.168.0.0/16' /etc/apache2/mods-enabled/status.conf; \
sed -i -e '/Require local/ a \ Require ip 10.0.0.0/8' /etc/apache2/mods-enabled/status.conf; \
fi
# Add support for memcached
RUN export DEBIAN_FRONTEND=noninteractive && \
case $(echo $PHP_VERSION | cut -d '.' -f 1,2) in \
5.6) export MEMCACHED_VERSION="memcached-2.2.0";; \
7.*) export MEMCACHED_VERSION="memcached-3.1.3";; \
*) echo "Unsuported PHP version: $PHP_VERSION"; exit 1;; \
esac && \
apt-get update -y && \
apt-get install -y zlib1g-dev libmemcached-dev && \
pecl install $MEMCACHED_VERSION && \
docker-php-ext-enable memcached && \
apt-get remove -y --purge zlib1g-dev && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["/bin/bash", "/usr/local/bin/entrypoint.sh"]
CMD ["apache2-foreground"]