Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize #561

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.dockerignore
.git
.gitattributes
.github
.gitignore
Dockerfile
README.md
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:2-alpine

RUN apk add --no-cache musl-dev gcc
RUN pip install twisted

COPY . /app
WORKDIR /app

ENTRYPOINT ["python", "master_server.py"]
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
backend:
build:
context: .
network_mode: "host"

proxy:
build:
context: tools/docker/apache-hosts
# environment:
# - DWC_HOST=example.com
network_mode: "host"
19 changes: 19 additions & 0 deletions tools/docker/apache-hosts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM httpd:2.4-alpine

ENV APACHE_LOG_DIR=/usr/local/apache2/logs

# Change this if you have your own domain name set up
# Otherwise, you will need to set up a DNS server to point nintendowifi.net to your IP address
ENV DWC_HOST=nintendowifi.net

# vhost config
RUN echo $'IncludeOptional /usr/local/apache2/vhost.d/*.conf\n\
ServerName localhost\n\
HttpProtocolOptions Unsafe' >> conf/httpd.conf

# Enable proxy module
RUN sed -i 's/^#LoadModule proxy_module/LoadModule proxy_module/' conf/httpd.conf
RUN sed -i 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' conf/httpd.conf

# Copy vhosts
COPY *.conf vhost.d/
9 changes: 9 additions & 0 deletions tools/docker/apache-hosts/dls1.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName dls1.${DWC_HOST}
ServerAlias "dls1.${DWC_HOST}"
ServerAlias "dls1.${DWC_HOST}, dls1.${DWC_HOST}"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9003/
ProxyPassReverse / http://127.0.0.1:9003/
</VirtualHost>
8 changes: 8 additions & 0 deletions tools/docker/apache-hosts/gamestats.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gamestats.gs.${DWC_HOST}
ServerAlias "gamestats.gs.${DWC_HOST}, gamestats.gs.${DWC_HOST}"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9002/
ProxyPassReverse / http://127.0.0.1:9002/
</VirtualHost>
10 changes: 10 additions & 0 deletions tools/docker/apache-hosts/gamestats2.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName gamestats2.gs.${DWC_HOST}
ServerAlias "gamestats2.gs.${DWC_HOST}, gamestats2.gs.${DWC_HOST}"

ProxyPreserveHost On

ProxyPass / http://127.0.0.1:9002/
ProxyPassReverse / http://127.0.0.1:9002/
</VirtualHost>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName naswii.${DWC_HOST}
ServerAlias "naswii.${DWC_HOST}, naswii.${DWC_HOST}"
ServerAlias "nas.${DWC_HOST}"
ServerAlias "nas.${DWC_HOST}, nas.${DWC_HOST}"
ServerAlias "conntest.${DWC_HOST}"
ServerAlias "conntest.${DWC_HOST}, conntest.${DWC_HOST}"
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:9000/
ProxyPassReverse / http://127.0.0.1:9000/
</VirtualHost>
11 changes: 11 additions & 0 deletions tools/docker/apache-hosts/sake.gs.nintendowifi.net.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName sake.gs.${DWC_HOST}
ServerAlias sake.gs.${DWC_HOST} *.sake.gs.${DWC_HOST}
ServerAlias secure.sake.gs.${DWC_HOST}
ServerAlias secure.sake.gs.${DWC_HOST} *.secure.sake.gs.${DWC_HOST}

ProxyPass / http://127.0.0.1:8000/

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>