forked from fausecteam/ctf-gameserver
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
1,125 additions
and
323 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "saarctf-gameserver"] | ||
path = saarctf-gameserver | ||
url = https://github.com/ECSC2022/saarctf-gameserver.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
FROM python:3.8 as gameserver-base | ||
RUN apt-get update && apt-get install -y libmemcached-dev libsystemd-dev postgresql-client && rm -rf /var/lib/apt/lists/* | ||
ADD src /opt/ctf-gameserver/src/ | ||
ADD scripts /opt/ctf-gameserver/scripts/ | ||
ADD setup.py Makefile /opt/ctf-gameserver/ | ||
RUN cd /opt/ctf-gameserver && make ext | ||
RUN mkdir -p /etc/ctf-gameserver | ||
RUN pip install /opt/ctf-gameserver[prod] | ||
|
||
FROM gameserver-base as web | ||
RUN pip install uwsgi | ||
RUN mkdir /uploads && chmod -R 777 /uploads | ||
ADD conf/web/prod_settings.py /etc/ctf-gameserver/web/ | ||
ADD doc/controller/scoring.sql /scoring.sql | ||
ADD doc/controller/scoreboard_v2.sql /scoreboard_v2.sql | ||
ENV CTF_IPPATTERN=10.10.%s.1 | ||
EXPOSE 5000 | ||
CMD uwsgi --http-socket 0.0.0.0:5000 --module ctf_gameserver.web.wsgi \ | ||
--python-path=/etc/ctf-gameserver/web \ | ||
--env "CTF_IPPATTERN=${CTF_IPPATTERN}" \ | ||
--env "DJANGO_SETTINGS_MODULE=prod_settings" \ | ||
--static-map '/static/admin=/usr/local/lib/python3.8/site-packages/django/contrib/admin/static/admin' \ | ||
--static-map '/static=/usr/local/lib/python3.8/site-packages/ctf_gameserver/web/static' | ||
|
||
FROM web as web-init | ||
RUN pip install ansible passlib | ||
COPY ./init/docker-init.sh /bin/ | ||
COPY ./init/ansible /ansible/ | ||
CMD /bin/docker-init.sh | ||
|
||
FROM gameserver-base as submission | ||
RUN useradd -m -U -s /bin/bash ctf-submission | ||
USER ctf-submission | ||
ENTRYPOINT [ "ctf-submission" ] | ||
|
||
FROM gameserver-base as controller | ||
RUN useradd -m -U -s /bin/bash ctf-controller | ||
USER ctf-controller | ||
ENTRYPOINT [ "ctf-controller" ] | ||
|
||
FROM gameserver-base as checkerbase | ||
RUN apt-get update && apt-get install -y sudo && rm -rf /var/lib/apt/lists/* | ||
RUN useradd -m -U -s /bin/bash ctf-checkermaster | ||
RUN useradd -m -U -s /bin/bash ctf-checkerrunner | ||
ADD examples/checker/sudoers.d/ctf-checker /etc/sudoers.d/ | ||
ADD scripts/checker/docker-entrypoint.sh /sbin/ | ||
#USER ctf-checkermaster # do this downstream checkers | ||
ENV CTF_SUDOUSER ctf-checkerrunner | ||
ENTRYPOINT [ "/sbin/docker-entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.