-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
76 lines (60 loc) · 1.89 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
FROM ubuntu:14.04
MAINTAINER TuRzAm
# Server Name
ENV SERVERNAME "servertest"
# Admin DB Password (required for the first launch)
ENV ADMINPASSWORD "adminpassword"
# Rcon Password (used to quit the server)
ENV RCON_PASSWORD "rconpassword"
# Steam port
ENV STEAMPORT1 8766
ENV STEAMPORT2 8767
# Game port
ENV GAMEPORT 16261
# Stop apt-get asking to get Dialog frontend
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
lib32gcc1 \
default-jre \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Run commands as the steam user
RUN adduser \
--disabled-login \
--shell /bin/bash \
--gecos "" \
steam
# Copy & rights to folders
COPY update.sh /home/steam/update.sh
COPY rcon /home/steam/rcon
RUN chmod 777 /home/steam/update.sh
RUN chmod 777 /home/steam/rcon
RUN mkdir -p /home/steam/Zomboid && chown -R steam /home/steam/Zomboid
RUN mkdir -p /home/steam/projectzomboid && chown -R steam /home/steam/projectzomboid
# Create slink
RUN ln -s /home/steam/projectzomboid /server-files && chown -R steam /server-files
RUN ln -s /home/steam/Zomboid /server-data && chown -R steam /server-data
USER steam
# download steamcmd
RUN mkdir /home/steam/steamcmd &&\
cd /home/steam/steamcmd &&\
curl http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar -vxz
# First run is on anonymous to download the app
RUN /home/steam/steamcmd/steamcmd.sh +login anonymous +quit
# Make server port available to host : (10 slots)
# 8766,8767 : steamport
# 16261 : server port : tcp
# 27015 : Rcon port
EXPOSE ${STEAMPORT1}
EXPOSE ${STEAMPORT2}
EXPOSE ${GAMEPORT}
EXPOSE 27015
# /home/steam/Zomboid : Server Data
# /home/steam/projectzomboid : Server files & exe
#VOLUME [ "/home/steam/Zomboid" , "/home/steam/projectzomboid" ]
VOLUME /server-files
VOLUME /server-data
# Update game (with credential) && launch the game.
ENTRYPOINT ["/home/steam/update.sh"]