forked from rwanyoike/srb2kart-server-docker
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
78 lines (66 loc) · 2.09 KB
/
Dockerfile
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM alpine:latest
# Ref: https://github.com/STJr/Kart-Public/releases
ARG SRB2KART_VERSION=1.6
# Ref: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=srb2kart-data
RUN set -ex \
&& apk add --no-cache --virtual .build-deps curl \
&& mkdir -p /srb2kart-data \
&& curl -L -o /tmp/AssetsLinuxOnly.zip https://github.com/STJr/Kart-Public/releases/download/v${SRB2KART_VERSION}/AssetsLinuxOnly.zip \
&& unzip -d /srb2kart-data /tmp/AssetsLinuxOnly.zip \
&& find /srb2kart-data/mdls -type d -exec chmod 0755 {} \; \
&& mkdir -p /usr/games \
&& mv /srb2kart-data /usr/games/SRB2kart \
&& rm /tmp/AssetsLinuxOnly.zip \
&& apk del .build-deps
# Ref: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=srb2kart
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
bash \
curl-dev \
curl-static \
gcc \
git \
gzip \
libc-dev \
libpng-dev \
libpng-static \
make \
nghttp2-static \
openssl-libs-static \
sdl2_mixer-dev \
sdl2-dev \
sdl2 \
zlib-dev \
zlib-static \
&& mkdir -p /data \
&& git clone --depth=1 -b v${SRB2KART_VERSION} https://github.com/STJr/Kart-Public.git /srb2kart \
&& (cd /srb2kart/src \
&& make -j$(nproc) LINUX64=1 NOHW=1 NOGME=1) \
&& cp /srb2kart/bin/Linux64/Release/lsdl2srb2kart /usr/bin/srb2kart \
&& apk del .build-deps \
&& rm -rf /srb2kart
# Adding in game dependancies and nginx
RUN apk add --no-cache \
curl-dev \
curl-static \
libpng-dev \
libpng-static \
sdl2_mixer-dev \
sdl2-dev \
sdl2 \
nginx \
zip
# Volumes
VOLUME /kart
# Copy over all the scripts
COPY --chmod=755 srb2kart.sh /usr/bin/srb2kart.sh
COPY default.conf /etc/nginx/http.d/default.conf
RUN echo "1" > /run/nginx/nginx.pid
# Make all the folders and links
RUN ln -s /kart /root/.srb2kart
WORKDIR /usr/games/SRB2kart
EXPOSE 5029/udp
EXPOSE 80/udp
COPY srb2kart.sh /usr/bin/srb2kart.sh
RUN chmod a+x /usr/bin/srb2kart.sh
ENTRYPOINT [ "srb2kart.sh" ]