Skip to content

Commit 625854c

Browse files
author
Móveis Simonetti
authored
Merge pull request #6 from jalxes/patch-1
Update Dockerfile
2 parents c308a2a + 9359249 commit 625854c

File tree

1 file changed

+49
-42
lines changed

1 file changed

+49
-42
lines changed

Dockerfile

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,67 @@ FROM php:7.2-apache
33

44
ENV http_proxy ${HTTP_PROXY}
55
ENV https_proxy ${HTTP_PROXY}
6+
ENV XDEBUG_ENABLED=false
7+
ENV NR_ENABLED=false
8+
ENV NR_APP_NAME=""
9+
ENV NR_LICENSE_KEY=""
10+
ENV SESSION_HANDLER=false
11+
ENV SESSION_HANDLER_NAME=""
12+
ENV SESSION_HANDLER_PATH=""
613

7-
COPY configs/ports.conf /etc/apache2/ports.conf
8-
COPY apache-run.sh /usr/bin/apache-run
9-
10-
RUN chmod a+x /usr/bin/apache-run
11-
12-
# Install libs
13-
RUN apt-get update && apt-get install -y wget supervisor libfreetype6-dev \
14-
libjpeg62-turbo-dev libpng-dev git libxslt-dev \
15-
libldap2-dev libicu-dev libc-client-dev libkrb5-dev
14+
RUN apt-get update && apt-get install -y wget vim supervisor zip libfreetype6-dev libjpeg62-turbo-dev \
15+
libmcrypt-dev libpng-dev libssl-dev libaio1 git libcurl4-openssl-dev libxslt-dev \
16+
libldap2-dev libicu-dev libc-client-dev libkrb5-dev libsqlite3-dev libedit-dev \
17+
sudo
1618

1719
RUN a2enmod rewrite
1820

19-
# Install PHP extensions
2021
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
2122
&& docker-php-ext-configure hash --with-mhash \
2223
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
2324
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
24-
&& docker-php-ext-install -j$(nproc) bcmath \
25-
gd pdo_mysql calendar exif gettext \
26-
xsl ldap intl imap \
27-
pcntl shmop soap sockets wddx zip
28-
29-
# Install ssh2
30-
RUN apt-get update && apt-get -y install libssh2-1-dev && \
31-
pecl install -f ssh2-alpha && \
32-
echo "extension=ssh2.so" >> /usr/local/etc/php/conf.d/ssh2.ini && \
33-
rm -rf /var/lib/apt/lists/*
34-
35-
# Install oci8
36-
RUN apt-get update && apt-get -y install wget bsdtar libaio1 && \
37-
wget -qO- https://raw.githubusercontent.com/caffeinalab/php-fpm-oci8/master/oracle/instantclient-basic-linux.x64-12.2.0.1.0.zip | bsdtar -xvf- -C /usr/local && \
38-
wget -qO- https://raw.githubusercontent.com/caffeinalab/php-fpm-oci8/master/oracle/instantclient-sdk-linux.x64-12.2.0.1.0.zip | bsdtar -xvf- -C /usr/local && \
39-
wget -qO- https://raw.githubusercontent.com/caffeinalab/php-fpm-oci8/master/oracle/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip | bsdtar -xvf- -C /usr/local && \
40-
ln -s /usr/local/instantclient_12_2 /usr/local/instantclient && \
41-
ln -s /usr/local/instantclient/libclntsh.so.* /usr/local/instantclient/libclntsh.so && \
42-
ln -s /usr/local/instantclient/lib* /usr/lib && \
43-
ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus && \
44-
docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/local/instantclient && \
45-
docker-php-ext-install oci8 && \
46-
rm -rf /var/lib/apt/lists/* && \
47-
php -v
48-
49-
# Install redis
25+
&& docker-php-ext-install -j$(nproc) iconv bcmath mcrypt \
26+
gd pdo_mysql calendar curl exif ftp gettext \
27+
hash xsl ldap intl imap pdo_sqlite mbstring \
28+
mcrypt pcntl readline shmop soap sockets wddx zip
29+
5030
RUN pecl install redis \
51-
&& docker-php-ext-enable redis
31+
&& echo "extension=redis.so" >> /usr/local/etc/php/conf.d/redis.ini
32+
33+
RUN echo "---> Adding Support for NewRelic" && \
34+
mkdir /tmp/newrelic /scripts/ && \
35+
cd /tmp/newrelic && \
36+
wget -r -l1 -nd -A"linux.tar.gz" https://download.newrelic.com/php_agent/release/ && \
37+
gzip -dc newrelic*.tar.gz | tar xf - && \
38+
cd newrelic-php5* && \
39+
rm -f /usr/local/lib/php/extensions/no-debug-non-zts-20151012/newrelic.so && \
40+
cp ./agent/x64/newrelic-20151012.so /usr/local/lib/php/extensions/no-debug-non-zts-20151012/newrelic.so && \
41+
cp ./daemon/newrelic-daemon.x64 /usr/bin/newrelic-daemon && \
42+
cp ./scripts/newrelic.ini.template /scripts/newrelic.ini && \
43+
mkdir /var/log/newrelic && \
44+
chown -R www-data:www-data /var/log/newrelic && \
45+
rm -rf /tmp/*
46+
47+
RUN echo "---> Adding Tini" && \
48+
wget -O /tini https://github.com/krallin/tini/releases/download/v0.18.0/tini-static && \
49+
chmod +x /tini
50+
51+
RUN echo "---> Config sudoers" && \
52+
echo "www-data ALL = ( ALL ) NOPASSWD: ALL" >> /etc/sudoers
5253

53-
# Install Composer
5454
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer
5555

56-
# Install XDebug
5756
RUN pecl install xdebug
5857

59-
# Run composer install
60-
CMD /usr/bin/apache-run
58+
COPY configs/ports.conf /etc/apache2/ports.conf
59+
COPY apache-run.sh /usr/bin/apache-run
60+
61+
RUN chmod a+x /usr/bin/apache-run
62+
63+
USER www-data
64+
65+
WORKDIR "/var/www/html"
66+
67+
EXPOSE 8080 9001
6168

62-
EXPOSE 8080
69+
CMD ["/tini", "--", "/usr/bin/apache-run"]

0 commit comments

Comments
 (0)