-
Notifications
You must be signed in to change notification settings - Fork 25
/
Dockerfile
executable file
·78 lines (73 loc) · 2.46 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
76
77
78
FROM php:5.6-apache-jessie
MAINTAINER Brett Tasker "<[email protected]>"
ENV DEBIAN_FRONTEND=noninteractive
# Install components
RUN apt-get update -y && apt-get install -y \
curl \
git-core \
gzip \
libcurl4-openssl-dev \
libgd-dev \
libldap2-dev \
libmcrypt-dev \
libtidy-dev \
libxslt-dev \
zlib1g-dev \
libicu-dev \
g++ \
openssh-client \
unzip \
zip \
--no-install-recommends && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# Install PHP Extensions
RUN docker-php-ext-configure intl && \
docker-php-ext-configure mysql --with-mysql=mysqlnd && \
docker-php-ext-configure mysqli --with-mysqli=mysqlnd && \
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-install -j$(nproc) \
bcmath \
intl \
gd \
ldap \
mcrypt \
mysql \
mysqli \
pdo \
pdo_mysql \
soap \
tidy \
xsl \
zip
# Apache + xdebug configuration
RUN { \
echo "<VirtualHost *:80>"; \
echo " DocumentRoot /var/www/html"; \
echo " LogLevel warn"; \
echo " ErrorLog /var/log/apache2/error.log"; \
echo " CustomLog /var/log/apache2/access.log combined"; \
echo " ServerSignature Off"; \
echo " <Directory /var/www/html>"; \
echo " Options +FollowSymLinks"; \
echo " Options -ExecCGI -Includes -Indexes"; \
echo " AllowOverride all"; \
echo; \
echo " Require all granted"; \
echo " </Directory>"; \
echo " <LocationMatch assets/>"; \
echo " php_flag engine off"; \
echo " </LocationMatch>"; \
echo; \
echo " IncludeOptional sites-available/000-default.local*"; \
echo "</VirtualHost>"; \
} | tee /etc/apache2/sites-available/000-default.conf
RUN echo "ServerName localhost" > /etc/apache2/conf-available/fqdn.conf && \
echo "date.timezone = Pacific/Auckland" > /usr/local/etc/php/conf.d/timezone.ini && \
echo "log_errors = On\nerror_log = /dev/stderr" > /usr/local/etc/php/conf.d/errors.ini && \
a2enmod rewrite expires remoteip cgid && \
usermod -u 1000 www-data && \
usermod -G staff www-data
EXPOSE 80
CMD ["apache2-foreground"]