forked from mbround18/valheim-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (68 loc) · 2.86 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
# ------------------ #
# -- Odin Builder -- #
# ------------------ #
ARG ODIN_IMAGE_VERSION=latest
FROM mbround18/valheim-odin:${ODIN_IMAGE_VERSION} as runtime
# --------------- #
# -- Steam CMD -- #
# --------------- #
FROM cm2network/steamcmd:root
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
htop net-tools nano gcc g++ gdb \
netcat curl wget zip unzip \
cron sudo gosu dos2unix \
libsdl2-2.0-0 jq libc6-dev \
&& rm -rf /var/lib/apt/lists/* \
&& gosu nobody true \
&& dos2unix
# Container informaiton
ARG GITHUB_SHA="not-set"
ARG GITHUB_REF="not-set"
ARG GITHUB_REPOSITORY="not-set"
# User config
ENV PUID=1000 \
PGID=1000 \
# Set up timezone information
TZ=America/Los_Angeles \
# Server Specific env variables.
PORT="2456" \
NAME="Valheim Docker" \
WORLD="Dedicated" \
PUBLIC="1" \
PASSWORD="" \
# Auto Update Configs
AUTO_UPDATE="0" \
AUTO_UPDATE_SCHEDULE="0 1 * * *" \
# Auto Backup Configs
AUTO_BACKUP="0" \
AUTO_BACKUP_SCHEDULE="*/15 * * * *" \
AUTO_BACKUP_REMOVE_OLD="1" \
AUTO_BACKUP_DAYS_TO_LIVE="3" \
AUTO_BACKUP_ON_UPDATE="0" \
AUTO_BACKUP_ON_SHUTDOWN="0" \
AUTO_BACKUP_PAUSE_WITH_NO_PLAYERS="0" \
UPDATE_ON_STARTUP="1" \
SAVE_LOCATION="/home/steam/.config/unity3d/IronGate/Valheim" \
MODS_LOCATION="/home/steam/staging/mods" \
GAME_LOCATION="/home/steam/valheim" \
BACKUP_LOCATION="/home/steam/backups" \
TYPE="Vanilla"
COPY ./src/scripts/*.sh /home/steam/scripts/
COPY ./src/scripts/entrypoint.sh /entrypoint.sh
COPY --from=runtime /usr/local/bin/odin /usr/local/bin/odin
COPY --from=runtime /usr/local/bin/odin-http-server /usr/local/bin/odin-http-server
COPY ./src/scripts/steam_bashrc.sh /home/steam/.bashrc
RUN usermod -u ${PUID} steam \
&& groupmod -g ${PGID} steam \
&& chsh -s /bin/bash steam \
&& printf "${GITHUB_SHA}\n${GITHUB_REF}\n${GITHUB_REPOSITORY}\n" >/home/steam/.version \
&& chmod 755 -R /home/steam/scripts/ \
&& chmod 755 /entrypoint.sh \
&& chmod 755 /usr/local/bin/odin \
&& dos2unix /entrypoint.sh /home/steam/.bashrc /home/steam/scripts/*.sh
HEALTHCHECK --interval=1m --timeout=3s \
CMD pidof valheim_server.x86_64 || exit 1
ENTRYPOINT ["/bin/bash","/entrypoint.sh"]
CMD ["/bin/bash", "/home/steam/scripts/start_valheim.sh"]