forked from rfvgyhn/docker-avorion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (41 loc) · 1.63 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
FROM cm2network/steamcmd:steam as build
ARG VERSION
ARG INSTALL_ARGS
RUN set -x \
&& "${STEAMCMDDIR}/steamcmd.sh" \
+force_install_dir /home/steam/avorion-dedicated \
+login anonymous \
+app_update 565060 $INSTALL_ARGS validate \
+quit
WORKDIR /home/steam/avorion-dedicated
RUN rm -r steamapps && \
rm launcher.sh
FROM debian:stable-slim
LABEL org.opencontainers.image.title="Avorion Dedicated Server"
LABEL org.opencontainers.image.url="https://www.avorion.net/"
ARG DEBIAN_FRONTEND=noninteractive
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ca-certificates libsdl2-2.0-0 \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& useradd -m steam \
&& mkdir -p /home/steam/.avorion/galaxies/avorion_galaxy \
&& chown -R steam:steam /home/steam
WORKDIR /home/steam/avorion-dedicated
COPY --from=build --chown=steam /home/steam/avorion-dedicated .
USER steam
VOLUME /home/steam/.avorion/galaxies/avorion_galaxy
EXPOSE 27000/tcp
EXPOSE 27000/udp
EXPOSE 27003/udp
EXPOSE 27020/udp
EXPOSE 27021/udp
# down here we are basically copying the server.sh, since that one does not `exec`
# since now the AvorionServer is pid1 we can use `stop` commands since SIGTERM is passed through
# SIGTERM on AvorionServer causes a clean shutdown with saving, graceful connection closing and everything
# env from server.sh
ENV LD_LIBRARY_PATH="/home/steam/avorion-dedicated:/home/steam/avorion-dedicated/linux64"
# extra arguments can be supplied with the run command of your container runtime (equals the $@ of server.sh)
ENTRYPOINT ["./bin/AvorionServer", "--galaxy-name", "avorion_galaxy"]