2017-03-28 17:46:14 +00:00
|
|
|
FROM php:7.1-fpm-alpine
|
|
|
|
|
|
|
|
MAINTAINER Michael Contento <mail@michaelcontento.de>
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
# Install dependencies
|
|
|
|
apk add --no-cache nginx supervisor \
|
|
|
|
# Install PHP extension
|
2017-03-28 17:57:54 +00:00
|
|
|
&& docker-php-ext-install opcache \
|
2017-03-28 17:46:14 +00:00
|
|
|
# Remove (some of the) default nginx config
|
2017-03-28 17:57:54 +00:00
|
|
|
&& rm -f /etc/nginx.conf \
|
2017-03-28 17:46:14 +00:00
|
|
|
&& rm -rf /etc/nginx/sites-* \
|
|
|
|
&& rm -rf /var/log/nginx \
|
|
|
|
# Ensure nginx logs, even if the config has errors, are written to stderr
|
|
|
|
&& rm /var/lib/nginx/logs \
|
|
|
|
&& mkdir -p /var/lib/nginx/logs \
|
|
|
|
&& ln -s /dev/stderr /var/lib/nginx/logs/error.log \
|
|
|
|
# Remove default content from the default $DOCUMENT_ROOT ...
|
|
|
|
&& rm -rf /var/www \
|
|
|
|
# ... but ensure it exists with the right owner
|
|
|
|
&& mkdir -p /var/www \
|
|
|
|
&& chown www-data.www-data /var/www
|
|
|
|
|
|
|
|
WORKDIR /var/www
|
|
|
|
|
|
|
|
# Where nginx should serve from
|
|
|
|
ENV DOCUMENT_ROOT=/var/www
|
|
|
|
|
|
|
|
# Should we instantiate a redirect for apex-to-www? Or www-to-apex?
|
|
|
|
# Valid values are "none", "www-to-apex" or "apex-to-www"
|
|
|
|
ENV REDIRECT_MODE="none"
|
|
|
|
|
|
|
|
# Which HTTP code should we use for the above redirect
|
|
|
|
ENV REDIRECT_CODE=302
|
|
|
|
|
2017-03-28 18:13:15 +00:00
|
|
|
# And the protocol we should redirect to. Change this to "https" if you
|
|
|
|
# serve via https (e.g. with a SSL-termination proxy infront of this)
|
2017-03-29 17:23:29 +00:00
|
|
|
ENV REDIRECT_PROTO="auto"
|
2017-03-28 18:13:15 +00:00
|
|
|
|
2017-03-28 17:46:14 +00:00
|
|
|
ADD etc/ /etc/
|
|
|
|
ADD usr/ /usr/
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
CMD ["/usr/bin/docker-start"]
|