-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
126 lines (108 loc) · 4.32 KB
/
Dockerfile
File metadata and controls
126 lines (108 loc) · 4.32 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Vintage Story Server Docker Image for Debian 13 (Trixie)
# Based on the official Vintage Story server installation instructions, and extracted from server.sh
# for better Docker compatibility.
# Official guide: https://wiki.vintagestory.at/Guide:Dedicated_Server#Dedicated_server_on_Linux
FROM python:3.10-slim-trixie
EXPOSE 42420
# Variables from the server.sh
ARG USERNAME=vintagestory
ARG HOMEPATH=/vintagestory
ARG VSPATH=${HOMEPATH}/server
ARG DATAPATH=${HOMEPATH}/data
ENV SERVICE="${VSPATH}/VintagestoryServer.dll"
ENV USERNAME=${USERNAME}
ENV HOMEPATH=${HOMEPATH}
ENV VSPATH=${VSPATH}
ENV DATAPATH=${DATAPATH}
ARG VS_VERSION=1.21.6
ARG VERSION
ARG VS_VERSION_STATE=stable
ARG DOTNET_VERSION=8.0
ENV VS_VERSION=${VS_VERSION}
ENV VERSION=${VERSION}
ENV VS_VERSION_STATE=${VS_VERSION_STATE}
ENV DOTNET_VERSION=${DOTNET_VERSION}
LABEL org.opencontainers.image.source=https://github.com/DarkMatterProductions/vintagestory
LABEL org.opencontainers.image.description="Vintage Story Dedicated Server on Ubuntu 24.04"
LABEL org.opencontainers.image.licenses=MIT
LABEL in.dmpsys.maintainer="DarkMatter Productions"
LABEL in.dmpsys.project="Vintage Story Dedicated Server"
LABEL in.dmpsys.website="https://github.com/DarkMatterProductions/vintagestory"
LABEL in.dmpsys.vs.version="${VS_VERSION}"
LABEL in.dmpsys.image.version="${VERSION}"
# Server configuration defaults (can be overridden with -e flags at runtime)
ENV SERVER_NAME="Vintage Story Server"
ENV SERVER_DESCRIPTION=""
ENV SERVER_URL=""
ENV WELCOME_MESSAGE="Welcome {0}, may you survive well and prosper"
ENV SERVER_IP=""
ENV SERVER_PORT=42420
ENV SERVER_PASSWORD=""
ENV SERVER_UPNP=false
ENV SERVER_COMPRESS_PACKETS=true
ENV ADVERTISE_SERVER=false
ENV MAX_CLIENTS=16
ENV PASS_TIME_WHEN_EMPTY=false
ENV MAX_CHUNK_RADIUS=12
ENV SERVER_LANGUAGE="en"
ENV DEFAULT_ROLE_CODE="suplayer"
ENV ONLY_WHITELISTED=false
ENV ANTI_ABUSE="Off"
ENV ALLOW_PVP=true
ENV ALLOW_FIRE_SPREAD=true
ENV ALLOW_FALLING_BLOCKS=true
# Startup commands (e.g., "/op username" or "/op player1; /op player2")
ENV ADMIN_USERNAME=""
ENV STARTUP_COMMANDS=""
# World configuration defaults
ENV WORLD_SEED=""
ENV WORLD_NAME="Vintage Story World"
ENV SAVE_FILE_LOCATION="${DATAPATH}/Saves/default.vcdbs"
ENV ALLOW_CREATIVE_MODE=true
ENV PLAY_STYLE="surviveandbuild"
ENV WORLDCONFIG_TEMPORAL_STORMS="sometimes"
ENV WORLDCONFIG_TEMPORAL_RIFTS="visible"
ENV WORLDCONFIG_WORLD_CLIMATE="realistic"
ENV WORLDCONFIG_GAME_MODE="survival"
ENV WORLDCONFIG_DEATH_PUNISHMENT="drop"
ENV WORLDCONFIG_CREATURE_HOSTILITY="aggressive"
ENV WORLDCONFIG_PLAYER_HEALTH="15"
ENV WORLDCONFIG_HUNGER_SPEED="1"
ENV WORLDCONFIG_MOVE_SPEED="1.5"
ENV WORLDCONFIG_FOOD_SPOIL="1"
ENV WORLDCONFIG_SAPLING_GROWTH="1"
ENV WORLDCONFIG_TOOL_DURABILITY="1"
ENV WORLDCONFIG_ALLOW_COORDINATES=true
ENV WORLDCONFIG_ALLOW_MAP=true
# Install required .Net runtime
RUN apt update && \
apt install -yf wget curl vim gosu screen procps && \
wget https://packages.microsoft.com/config/debian/13/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm packages-microsoft-prod.deb && \
apt update
RUN apt install -y aspnetcore-runtime-${DOTNET_VERSION} && \
apt clean && rm -rf /var/lib/apt/lists/*
# Add user
ENV UID_NUMBER=1100
ENV GID_NUMBER=1100
RUN groupadd -g ${GID_NUMBER} ${USERNAME} && \
useradd -u ${UID_NUMBER} -g ${GID_NUMBER} -d ${HOMEPATH} -ms /bin/bash ${USERNAME}
WORKDIR ${HOMEPATH}
# Install Vintage Story server
RUN wget -P ${VSPATH} https://cdn.vintagestory.at/gamefiles/${VS_VERSION_STATE}/vs_server_linux-x64_${VS_VERSION}.tar.gz && \
tar -C ${VSPATH} -xvzf ${VSPATH}/vs_server_linux-x64_${VS_VERSION}.tar.gz && \
rm ${VSPATH}/vs_server_linux-x64_${VS_VERSION}.tar.gz && \
chown -R ${USERNAME}: ${HOMEPATH}
COPY vintage_rcon_client/requirements.txt /vintage_rcon_client/requirements.txt
RUN python -m pip install --no-cache-dir -r "/vintage_rcon_client/requirements.txt" && \
pip3 install --break-system-packages pyyaml
# Copy entrypoint and config generator
COPY entrypoint.sh ${HOMEPATH}/entrypoint.sh
COPY generate-config.py ${HOMEPATH}/generate-config.py
COPY server-config.yaml ${HOMEPATH}/server-config.yaml
COPY vintage_rcon_client /vintage_rcon_client
# Set permissions, change ownership
RUN chmod 755 ${HOMEPATH}/entrypoint.sh && \
chown -R ${USERNAME}: ${HOMEPATH}
ENTRYPOINT ["./entrypoint.sh"]