2020-01-03 20:07:42 +08:00
|
|
|
FROM webdevops/apache:ubuntu-18.04
|
2016-07-28 08:35:58 +08:00
|
|
|
|
2018-03-16 17:34:47 +08:00
|
|
|
LABEL maintainer="Eric Pfeiffer <computerfr33k@users.noreply.github.com>"
|
2016-07-28 08:35:58 +08:00
|
|
|
|
2017-08-04 05:50:20 +08:00
|
|
|
ARG PHP_UPSTREAM_CONTAINER=php-fpm
|
|
|
|
ARG PHP_UPSTREAM_PORT=9000
|
2017-09-18 21:24:48 +08:00
|
|
|
ARG PHP_UPSTREAM_TIMEOUT=60
|
2018-03-18 17:34:15 +08:00
|
|
|
ARG DOCUMENT_ROOT=/var/www/
|
2016-07-28 08:35:58 +08:00
|
|
|
|
2017-08-04 05:50:20 +08:00
|
|
|
ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}
|
2016-07-28 08:35:58 +08:00
|
|
|
|
2018-03-18 17:34:15 +08:00
|
|
|
ENV WEB_DOCUMENT_ROOT=${DOCUMENT_ROOT}
|
2016-07-28 08:35:58 +08:00
|
|
|
|
2017-09-18 21:24:48 +08:00
|
|
|
ENV WEB_PHP_TIMEOUT=${PHP_UPSTREAM_TIMEOUT}
|
|
|
|
|
2016-07-28 08:35:58 +08:00
|
|
|
EXPOSE 80 443
|
|
|
|
|
2017-08-04 05:51:20 +08:00
|
|
|
WORKDIR /var/www/
|
2016-07-28 08:35:58 +08:00
|
|
|
|
2017-05-01 18:41:55 +08:00
|
|
|
COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf
|
2017-03-09 10:26:47 +08:00
|
|
|
|
2020-09-03 16:46:24 +08:00
|
|
|
ARG APACHE_INSTALL_HTTP2=false
|
|
|
|
RUN if [ ${APACHE_INSTALL_HTTP2} = true ]; then \
|
|
|
|
mkdir /etc/apache2/ssl 2> /dev/null && \
|
|
|
|
&& openssl genrsa -out "/etc/apache2/ssl/ssl_site.key" 2048 \
|
|
|
|
&& openssl rand -out /root/.rnd -hex 256 \
|
|
|
|
&& openssl req -new -key "/etc/apache2/ssl/ssl_site.key" -out "/etc/apache2/ssl/ssl_site.csr" -subj "/CN=site.com/O=LGS/C=IT" \
|
|
|
|
&& openssl x509 -req -days 365 -in "/etc/apache2/ssl/ssl_site.csr" -signkey "/etc/apache2/ssl/ssl_site.key" -out "/etc/apache2/ssl/ssl_site.crt" \
|
|
|
|
&& a2enmod rewrite \
|
|
|
|
&& a2enmod headers \
|
|
|
|
&& a2enmod proxy proxy_html proxy_http xml2enc ssl http2 \
|
|
|
|
&& service apache2 restart \
|
|
|
|
;fi
|
|
|
|
|
2016-07-28 08:35:58 +08:00
|
|
|
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
|
|
|
|
|
|
|
|
CMD ["supervisord"]
|