-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
56 lines (46 loc) · 1.48 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
FROM golang:latest AS downloader
ARG PA_STREAM_NAME=stable
ARG PANET_USERNAME
ARG PANET_PASSWORD
# Download papatcher and use it to download the server
RUN mkdir -p /patserver && \
curl -o /tmp/papatcher.go https://raw.githubusercontent.com/planetary-annihilation/papatcher/master/papatcher.go && \
go run /tmp/papatcher.go \
--stream=${PA_STREAM_NAME} \
--update-only \
--dir=/patserver \
--username ${PANET_USERNAME} \
--password ${PANET_PASSWORD}
FROM ubuntu AS runner
ARG UID=999
ARG GID=999
ARG PA_STREAM_NAME=stable
ENV INSTALL_LOC=/patserver
ENV REPLAYS_LOC=/replays
ENV DEBIAN_FRONTEND=noninteractive
# Install PAT dependencies
RUN apt-get update && \
apt-get install -y libsdl2-2.0-0 libgl1 libstdc++6 libcurl3-gnutls libuuid1
# Create user
RUN groupadd -g ${GID} patuser && \
useradd -m -u ${UID} -g patuser patuser
USER patuser
# Get the server files
COPY --from=downloader --chown=patuser /patserver/$PA_STREAM_NAME $INSTALL_LOC
COPY --chown=patuser ./docker-entrypoint.sh /docker-entrypoint.sh
COPY healthcheck.sh /healthcheck.sh
ENV PA_TITANS_ENABLED=yes
ENV PA_AI_ENABLED=yes
ENV PA_SERVER_NAME="A Dockerised PA:T Server"
ENV PA_SERVER_PASSWORD="letmein"
ENV PA_MAX_PLAYERS=12
ENV PA_MAX_SPECTATORS=5
ENV PA_SPECTATORS=5
ENV PA_REPLAY_TIMEOUT=180
ENV PA_GAMEOVER_TIMEOUT=360
ENV PA_EMPTY_TIMEOUT=3600
HEALTHCHECK CMD /healthcheck.sh
VOLUME $REPLAYS_LOC
EXPOSE 20545
WORKDIR $INSTALL_LOC
ENTRYPOINT ["/bin/bash", "/docker-entrypoint.sh"]