-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (24 loc) · 1.04 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
FROM mcr.microsoft.com/dotnet/runtime:7.0
ENV STABLE_URL="https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_"
ENV UNSTABLE_URL="https://cdn.vintagestory.at/gamefiles/unstable/vs_server_linux-x64_"
# Install required packages
RUN apt-get update && apt-get install -y \
wget jq \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user and group with specific IDs
RUN useradd -u 1000 -m -s /bin/bash gameserver
# Create necessary directories
RUN mkdir -p /srv/gameserver/vintagestory \
/srv/gameserver/data/vs
# Set ownership
RUN chown -R gameserver:gameserver /srv/gameserver
WORKDIR /srv/gameserver/vintagestory
# Copy scripts into the container
COPY scripts/download_server.sh /srv/gameserver/vintagestory/
COPY scripts/check_and_start.sh /srv/gameserver/vintagestory/
# Make scripts executable and set ownership
RUN chmod +x /srv/gameserver/vintagestory/*.sh && \
chown gameserver:gameserver /srv/gameserver/vintagestory/*.sh
USER gameserver
EXPOSE 42420
ENTRYPOINT ["/srv/gameserver/vintagestory/check_and_start.sh"]