From 42400e7c50da2ce82c3cdab746d91959b541089c Mon Sep 17 00:00:00 2001 From: bisco Date: Mon, 6 Nov 2023 13:00:12 +0100 Subject: [PATCH] added proxy feature for webserver container --- webserver/000-default.conf | 8 ++++++++ webserver/Dockerfile.proxy | 18 ++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 webserver/000-default.conf create mode 100644 webserver/Dockerfile.proxy diff --git a/webserver/000-default.conf b/webserver/000-default.conf new file mode 100644 index 0000000..4001ef4 --- /dev/null +++ b/webserver/000-default.conf @@ -0,0 +1,8 @@ + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + ProxyPass / http://app:5000/ + \ No newline at end of file diff --git a/webserver/Dockerfile.proxy b/webserver/Dockerfile.proxy new file mode 100644 index 0000000..2174d14 --- /dev/null +++ b/webserver/Dockerfile.proxy @@ -0,0 +1,18 @@ +FROM debian:12-slim +RUN apt update +RUN apt install apache2 -y +RUN a2enmod proxy_http +RUN a2dissite 000-default +COPY index.html /var/www/html +COPY 000-default.conf /etc/apache2/sites-available +RUN a2ensite 000-default +EXPOSE 80 +RUN mkdir -p /var/run/apache2 &&\ + chown www-data:www-data /var/run/apache2 +ENV APACHE_RUN_DIR /var/run/apache2 +ENV APACHE_PID_FILE /var/run/apache2.pid +ENV APACHE_RUN_USER www-data +ENV APACHE_RUN_GROUP www-data +ENV APACHE_LOG_DIR /var/log/apache2 +ENV APACHE_SERVER_NAME localhost +CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"] \ No newline at end of file