Update Dockerfile

This commit is contained in:
Adrien le Maire 2021-02-10 15:56:06 +00:00
parent 2f0862d098
commit b807cc60bc

View File

@ -1,4 +1,6 @@
FROM debian:buster-20210208-slim FROM debian:buster-20210208-slim
ENV APACHE_CONFDIR /etc/apache2
ENV APACHE_ENVVARS $APACHE_CONFDIR/envvars
RUN set -ex; \ RUN set -ex; \
apt-get update -qqy; \ apt-get update -qqy; \
apt-get install -qqy --no-install-recommends \ apt-get install -qqy --no-install-recommends \
@ -21,9 +23,45 @@ RUN set -ex; \
libc-l10n \ libc-l10n \
; \ ; \
rm -rf /var/lib/apt/lists/*; \ rm -rf /var/lib/apt/lists/*; \
a2enmod rewrite; \ a2dismod mpm_event && a2enmod mpm_prefork && a2enmod rewrite; \
mkdir -p /etc/ssl/certs; \ mkdir -p /etc/ssl/certs; \
curl -fLSko /etc/ssl/certs/cacert.pem https://curl.se/ca/cacert.pem curl -fLSko /etc/ssl/certs/cacert.pem https://curl.se/ca/cacert.pem; \
sed -ri 's/^export ([^=]+)=(.*)$/: ${\1:=\2}\nexport \1/' "$APACHE_ENVVARS"; \
\
. "$APACHE_ENVVARS"; \
for dir in \
"$APACHE_LOCK_DIR" \
"$APACHE_RUN_DIR" \
"$APACHE_LOG_DIR" \
; do \
rm -rvf "$dir"; \
mkdir -p "$dir"; \
chown "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$dir"; \
chmod 777 "$dir"; \
done; \
\
rm -rvf /var/www/html/*; \
chmod 777 /var/www/html; \
\
# logs should go to stdout / stderr
ln -sfT /dev/stderr "$APACHE_LOG_DIR/error.log"; \
ln -sfT /dev/stdout "$APACHE_LOG_DIR/access.log"; \
ln -sfT /dev/stdout "$APACHE_LOG_DIR/other_vhosts_access.log"; \
chown -R --no-dereference "$APACHE_RUN_USER:$APACHE_RUN_GROUP" "$APACHE_LOG_DIR"; \
{ \
echo '<FilesMatch \.php$>'; \
echo '\tSetHandler application/x-httpd-php'; \
echo '</FilesMatch>'; \
echo; \
echo 'DirectoryIndex disabled'; \
echo 'DirectoryIndex index.php index.html'; \
echo; \
echo '<Directory /var/www/>'; \
echo '\tOptions -Indexes'; \
echo '\tAllowOverride All'; \
echo '</Directory>'; \
} | tee "$APACHE_CONFDIR/conf-available/docker-php.conf" \
&& a2enconf docker-php
ENV CURL_CA_BUNDLE=/etc/ssl/certs/cacert.pem \ ENV CURL_CA_BUNDLE=/etc/ssl/certs/cacert.pem \
SSL_CERT_FILE=/etc/ssl/certs/cacert.pem SSL_CERT_FILE=/etc/ssl/certs/cacert.pem