diff --git a/back/admin.Dockerfile b/back/admin.Dockerfile index da571eb..1c7fbe7 100644 --- a/back/admin.Dockerfile +++ b/back/admin.Dockerfile @@ -1,4 +1,5 @@ FROM debian:latest +ARG PORT=4441 # Install deps RUN apt-get update && apt-get install --yes \ @@ -12,7 +13,9 @@ RUN chown -R www-data:www-data /usr/lib/wgapi /var/log/wgapi /var/local/wgapi_to # Configure apache RUN a2enmod cgi rewrite -RUN sed -i 's|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|' \ +RUN sed -i "s/^Listen 80$/Listen ${PORT}/" /etc/apache2/ports.conf +RUN sed -i -e "s/^$//" \ + -e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \ /etc/apache2/sites-available/000-default.conf # Allow http user to run these binaries as root with sudo @@ -26,5 +29,5 @@ COPY admin_user.cgi /usr/lib/cgi-bin/user COPY lib/ /usr/lib/wgapi/ # Run time! -EXPOSE 80 +EXPOSE ${PORT} CMD ["apachectl", "-D", "FOREGROUND"] diff --git a/back/dashboard.Dockerfile b/back/dashboard.Dockerfile index da18b32..cc4bbd5 100644 --- a/back/dashboard.Dockerfile +++ b/back/dashboard.Dockerfile @@ -1,4 +1,5 @@ FROM debian:latest +ARG PORT=4442 # Install deps RUN apt-get update && apt-get install --yes \ @@ -12,8 +13,9 @@ RUN chown -R www-data:www-data /usr/lib/wgapi /var/log/wgapi /var/local/wgapi_to # Configure apache RUN a2enmod cgi rewrite -RUN sed -i "s/^Listen 80$/Listen ${DASHBOARD_PORT}/" /etc/apache2/ports.conf -RUN sed -i "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \ +RUN sed -i "s/^Listen 80$/Listen ${PORT}/" /etc/apache2/ports.conf +RUN sed -i -e "s/^$//" \ + -e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \ /etc/apache2/sites-available/000-default.conf # Allow http user to run these binaries as root with sudo @@ -27,5 +29,5 @@ COPY dashboard_ssl.cgi /usr/lib/cgi-bin/ssl COPY lib/ /usr/lib/wgapi/ # Run time! -EXPOSE 80 +EXPOSE ${PORT} CMD ["apachectl", "-D", "FOREGROUND"]