No can't use 80

master
Keith Irwin 2022-11-07 15:34:27 -07:00
parent 5e0df1dc95
commit 75821e01fd
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
2 changed files with 10 additions and 5 deletions

View File

@ -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/^<VirtualHost \*:80>$/<VirtualHost *:${PORT}>/" \
-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"]

View File

@ -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/^<VirtualHost \*:80>$/<VirtualHost *:${PORT}>/" \
-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"]