-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.prod
58 lines (45 loc) · 1.78 KB
/
Dockerfile.prod
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
FROM alpine:latest
MAINTAINER notbaab v0.9
RUN apk add --update \
python3 \
python3-dev
# to reduce image size all build and cleanup steps are performed in one docker layer
RUN \
echo "# INSTALL DEPENDENCIES ##########################################" && \
apk --no-cache add curl g++ gcc git make && \
mkdir -p /tmp/build && \
echo "# FETCH INSTALLATION FILES ######################################" && \
curl https://raw.githubusercontent.com/ioquake/ioq3/master/misc/linux/server_compile.sh -o /tmp/build/compile.sh && \
curl https://ioquake3.org/data/quake3-latest-pk3s.zip --referer https://ioquake3.org/extras/patch-data/ -o /tmp/build/quake3-latest-pk3s.zip && \
echo "# NOW THE INSTALLATION ##########################################" && \
echo "y" | sh /tmp/build/compile.sh && \
unzip /tmp/build/quake3-latest-pk3s.zip -d /tmp/build/ && \
cp -r /tmp/build/quake3-latest-pk3s/* ~/ioquake3
# Move some stuff into a known location
RUN adduser ioq3srv -D
RUN mv ~/ioquake3 /home/ioq3srv/
RUN chown ioq3srv -R /home/ioq3srv/
# install our log parser and server
RUN git clone https://github.com/notbaab/q3-logparser.git && \
cd q3-logparser && \
python3 setup.py install
WORKDIR /home/ioq3srv/
RUN git clone https://github.com/notbaab/q3-scoreboard.git && \
cd q3-scoreboard && \
python3 setup.py install
# TODO: Make install take a argument to give the path of the linux files?
ENV IOQ3_CONFIG=/home/ioq3srv/q3-scoreboard/docker-config.py
ENV FLASK_DEBUG=1
ENV FLASK_APP=q3_scoreboard
# Until we get an nginx server
ENV FLASK_RUN_HOST=0.0.0.0
RUN mkdir /patch-files
RUN mkdir /database
RUN chown ioq3srv -R /database
RUN chown ioq3srv -R /patch-files
USER ioq3srv
# Expose quake server port
EXPOSE 27960/udp
# Expose flask port
EXPOSE 5000/tcp
cmd ["flask", "run"]