-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
61 lines (47 loc) · 1.54 KB
/
Dockerfile
File metadata and controls
61 lines (47 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
FROM node:22 AS scoreboard_build
RUN mkdir /opt/scoreboard /opt/controlserver
WORKDIR /opt/scoreboard
ADD scoreboard/package.json scoreboard/package-lock.json /opt/scoreboard/
RUN --mount=type=cache,target=/root/.npm \
npm install
ADD scoreboard /opt/scoreboard
ADD controlserver/static /opt/controlserver/static
# TODO find a way to set this dynamically?
ENV SAARCTF_ENVIRONMENT=None
RUN npm run build
FROM node:22 AS frontend_build
WORKDIR /opt
ADD package.json /opt/
RUN --mount=type=cache,target=/root/.npm \
npm install
ADD controlserver/static /opt/controlserver/static
# TODO find a way to set this dynamically?
ENV SAARCTF_ENVIRONMENT=None
RUN npm run build
# the actual container with all python-based things
FROM python:3.13
WORKDIR /opt
ADD requirements* /opt/
ADD Makefile /opt/
ADD gamelib /opt/gamelib
RUN --mount=type=cache,target=/root/.cache \
make deps && \
. venv/bin/activate && \
pip install gunicorn && \
mkdir -p scoreboard
ADD alembic.ini /opt/alembic.ini
ADD checker_runner /opt/checker_runner
ADD controlserver /opt/controlserver
ADD migrations /opt/migrations
ADD run.sh /opt/run.sh
ADD saarctf_commons /opt/saarctf_commons
ADD sample_files /opt/sample_files
ADD scripts /opt/scripts
ADD vpn /opt/vpn
ADD vpnboard /opt/vpnboard
ADD wireguard-sync /opt/wireguard-sync
COPY --from=scoreboard_build /opt/scoreboard/dist /opt/scoreboard/dist
COPY --from=frontend_build /opt/controlserver/static /opt/controlserver/static
ENV FLASK_APP=controlserver/app.py
STOPSIGNAL SIGINT
ENTRYPOINT ["/opt/venv/bin/python"]