Moved env vars away from Dockerfiles
parent
fb5954e2d7
commit
176464a193
|
@ -1 +1,2 @@
|
||||||
etc/
|
etc/config
|
||||||
|
etc/servers
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
FROM debian:latest
|
FROM debian:latest
|
||||||
|
|
||||||
# Change these
|
|
||||||
ENV LISTEN_PORT=4441
|
|
||||||
ENV ADMIN_EMAIL='me@example.com'
|
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
RUN apt-get update && apt-get install --yes \
|
RUN apt-get update && apt-get install --yes \
|
||||||
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq \
|
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq \
|
||||||
|
@ -16,8 +12,8 @@ RUN chown -R www-data:www-data /usr/lib/wgapi /var/log/wgapi /var/local/wgapi_to
|
||||||
|
|
||||||
# Configure apache
|
# Configure apache
|
||||||
RUN a2enmod cgi rewrite
|
RUN a2enmod cgi rewrite
|
||||||
RUN sed -i "s/^Listen 80$/Listen ${LISTEN_PORT}/" /etc/apache2/ports.conf
|
RUN sed -i "s/^Listen 80$/Listen ${ADMIN_PORT}/" /etc/apache2/ports.conf
|
||||||
RUN sed -i -e "s/^<VirtualHost \*:80>$/<VirtualHost *:${LISTEN_PORT}>/" \
|
RUN sed -i -e "s/^<VirtualHost \*:80>$/<VirtualHost *:${ADMIN_PORT}>/" \
|
||||||
-e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
|
-e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
|
||||||
-e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
|
-e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
|
||||||
/etc/apache2/sites-available/000-default.conf
|
/etc/apache2/sites-available/000-default.conf
|
||||||
|
@ -33,5 +29,5 @@ COPY admin_user.cgi /usr/lib/cgi-bin/user
|
||||||
COPY lib/ /usr/lib/wgapi/
|
COPY lib/ /usr/lib/wgapi/
|
||||||
|
|
||||||
# Run time!
|
# Run time!
|
||||||
EXPOSE ${LISTEN_PORT}
|
EXPOSE ${ADMIN_PORT}
|
||||||
CMD ["apachectl", "-D", "FOREGROUND"]
|
CMD ["apachectl", "-D", "FOREGROUND"]
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
FROM debian:latest
|
FROM debian:latest
|
||||||
|
|
||||||
# Change these
|
|
||||||
ENV LISTEN_PORT=4442
|
|
||||||
ENV ADMIN_EMAIL='me@example.com'
|
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
RUN apt-get update && apt-get install --yes \
|
RUN apt-get update && apt-get install --yes \
|
||||||
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq \
|
sudo curl apache2 openssl wireguard-tools dnsutils ipv6calc jq \
|
||||||
|
@ -16,9 +12,9 @@ RUN chown -R www-data:www-data /usr/lib/wgapi /var/log/wgapi /var/local/wgapi_to
|
||||||
|
|
||||||
# Configure apache
|
# Configure apache
|
||||||
RUN a2enmod cgi rewrite
|
RUN a2enmod cgi rewrite
|
||||||
RUN sed -i "s/^Listen 80$/Listen ${LISTEN_PORT}/" \
|
RUN sed -i "s/^Listen 80$/Listen ${DASHBOARD_PORT}/" \
|
||||||
/etc/apache2/ports.conf
|
/etc/apache2/ports.conf
|
||||||
RUN sed -i -e "s/^<VirtualHost \*:80>$/<VirtualHost *:${LISTEN_PORT}>/" \
|
RUN sed -i -e "s/^<VirtualHost \*:80>$/<VirtualHost *:${DASHBOARD_PORT}>/" \
|
||||||
-e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
|
-e "s|DocumentRoot .*$|DocumentRoot /usr/lib/cgi-bin\n\tSetHandler cgi-script\n\tOptions +ExecCGI|" \
|
||||||
-e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
|
-e "s/ServerAdmin .*$/ServerAdmin ${ADMIN_EMAIL}/" \
|
||||||
/etc/apache2/sites-available/000-default.conf
|
/etc/apache2/sites-available/000-default.conf
|
||||||
|
@ -34,5 +30,5 @@ COPY dashboard_ssl.cgi /usr/lib/cgi-bin/ssl
|
||||||
COPY lib/ /usr/lib/wgapi/
|
COPY lib/ /usr/lib/wgapi/
|
||||||
|
|
||||||
# Run time!
|
# Run time!
|
||||||
EXPOSE ${LISTEN_PORT}
|
EXPOSE ${DASHBOARD_PORT}
|
||||||
CMD ["apachectl", "-D", "FOREGROUND"]
|
CMD ["apachectl", "-D", "FOREGROUND"]
|
||||||
|
|
|
@ -8,42 +8,44 @@ networks:
|
||||||
services:
|
services:
|
||||||
|
|
||||||
dashboard-backend:
|
dashboard-backend:
|
||||||
build:
|
build:
|
||||||
context: back
|
context: back
|
||||||
dockerfile: dashboard.Dockerfile
|
dockerfile: dashboard.Dockerfile
|
||||||
container_name: wgapi-dashboard-backend
|
container_name: wgapi-dashboard-backend
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
network_mode: host
|
network_mode: host
|
||||||
volumes:
|
env_file: etc/config
|
||||||
|
volumes:
|
||||||
- '/etc/ssl/private:/etc/ssl/private'
|
- '/etc/ssl/private:/etc/ssl/private'
|
||||||
- '/etc/wgapi:/etc/wgapi:ro'
|
- '/etc/wgapi:/etc/wgapi:ro'
|
||||||
- '/var/log/wgapi:/var/log/wgapi'
|
- '/var/log/wgapi:/var/log/wgapi'
|
||||||
|
|
||||||
dashboard-frontend:
|
dashboard-frontend:
|
||||||
build:
|
build:
|
||||||
context: front
|
context: front
|
||||||
dockerfile: dashboard.Dockerfile
|
dockerfile: dashboard.Dockerfile
|
||||||
container_name: wgapi-dashboard-frontend
|
container_name: wgapi-dashboard-frontend
|
||||||
networks:
|
networks:
|
||||||
wgapi:
|
wgapi:
|
||||||
ipv4_address: 172.19.0.2
|
ipv4_address: 172.19.0.2
|
||||||
|
|
||||||
admin-backend:
|
admin-backend:
|
||||||
build:
|
build:
|
||||||
context: back
|
context: back
|
||||||
dockerfile: admin.Dockerfile
|
dockerfile: admin.Dockerfile
|
||||||
cap_add:
|
cap_add:
|
||||||
- NET_ADMIN
|
- NET_ADMIN
|
||||||
network_mode: host
|
network_mode: host
|
||||||
container_name: wgapi-admin-backend
|
container_name: wgapi-admin-backend
|
||||||
volumes:
|
env_file: etc/config
|
||||||
|
volumes:
|
||||||
- '/var/log/wgapi:/var/log/wgapi'
|
- '/var/log/wgapi:/var/log/wgapi'
|
||||||
- '/etc/ssl/private:/etc/ssl/private'
|
- '/etc/ssl/private:/etc/ssl/private'
|
||||||
- '/etc/wgapi:/etc/wgapi:ro'
|
- '/etc/wgapi:/etc/wgapi:ro'
|
||||||
|
|
||||||
admin-frontend:
|
admin-frontend:
|
||||||
build:
|
build:
|
||||||
context: front
|
context: front
|
||||||
dockerfile: admin.Dockerfile
|
dockerfile: admin.Dockerfile
|
||||||
container_name: wgapi-admin-frontend
|
container_name: wgapi-admin-frontend
|
||||||
|
@ -52,12 +54,13 @@ services:
|
||||||
ipv4_address: 172.19.0.3
|
ipv4_address: 172.19.0.3
|
||||||
|
|
||||||
# fed-backend:
|
# fed-backend:
|
||||||
# build:
|
# build:
|
||||||
# context: back
|
# context: back
|
||||||
# dockerfile: fed.Dockerfile
|
# dockerfile: fed.Dockerfile
|
||||||
# cap_add:
|
# cap_add:
|
||||||
# - NET_ADMIN
|
# - NET_ADMIN
|
||||||
# network_mode: host
|
# network_mode: host
|
||||||
|
# env_file: etc/config
|
||||||
# container_name: wgapi-fed-backend
|
# container_name: wgapi-fed-backend
|
||||||
# volumes:
|
# volumes:
|
||||||
# - '/var/log/wgapi:/var/log/wgapi'
|
# - '/var/log/wgapi:/var/log/wgapi'
|
||||||
|
|
Loading…
Reference in New Issue