-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
121 lines (101 loc) · 3.35 KB
/
Containerfile
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
# Use Fedora minimal 36 as base image
FROM registry.fedoraproject.org/fedora-minimal:36
LABEL maintainer="Nodens- <info@abnormalfreq.com>"
# Add WineHQ repo
ADD winehq.repo /etc/yum.repos.d/winehq.repo
# Update and install packages
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 \
&& microdnf install -y \
glibc-langpack-en \
glibc-locale-source \
jq \
xorg-x11-server-Xvfb \
winehq-devel \
wine-mono \
mcrcon \
unzip \
bsdtar \
util-linux \
procps-ng \
samba-winbind \
--nodocs --setopt=install_weak_deps=0 \
&& microdnf clean all -y
# Create directories
RUN mkdir -p /steamcmd/vrising /app/vrising
# Install jobber
RUN curl -L -o /app/jobber-1.4.4-1.el8.x86_64.rpm https://github.com/dshearer/jobber/releases/download/v1.4.4/jobber-1.4.4-1.el8.x86_64.rpm \
&& rpm -i /app/jobber-1.4.4-1.el8.x86_64.rpm && rm -f /app/jobber-1.4.4-1.el8.x86_64.rpm
# Set locale
RUN localedef -f UTF-8 -i en_US en_US.UTF-8
# Further cleaning
RUN rm -f /etc/udev/hwdb.bin \
&& rm -rf /usr/lib/udev/hwdb.d/ \
&& rm -rf /boot \
&& rm -rf /var/lib/dnf/history.* \
&& rm -rf /usr/lib/locale/locale-archive* \
&& rm -rf /var/cache/* \
&& rm -rf /var/lib/rpm
# Expose necessary ports
EXPOSE 9876/udp
EXPOSE 9877/udp
EXPOSE 9878/tcp
# UID/GID variables to allow changing from compose.
ENV UID=1000
ENV GID=1000
# Add non-root user
RUN groupadd -g $GID vrserver \
&& useradd -ms /bin/bash -u $UID -g vrserver vrserver \
&& mkdir -p /home/vrserver/.wine /var/jobber/$UID \
&& echo -e "LANG="en_US.utf8"\nexport LANG" > /home/vrserver/.bashrc
# Add update job
ADD scripts/jobber /home/vrserver/.jobber
# Copy scripts
ADD scripts/rcon.sh /usr/bin/rcon
ADD scripts/start_vrising.sh /app/start.sh
ADD scripts/shutdown.sh /app/shutdown.sh
ADD scripts/update_check.sh /app/update_check.sh
ADD scripts/install.txt /app/install.txt
# Fix permissions
RUN chown -R vrserver:vrserver \
/steamcmd \
/app \
/home/vrserver \
/home/vrserver/.wine \
/dev/stdout \
/dev/stderr \
/var/jobber/1000 \
&& chmod 755 /usr/bin/rcon \
&& chmod -R 775 /home/vrserver/.wine
# Switch to vrserver user
ENV USER_ID=$USERID
ENV GROUP_ID=$GROUPID
ENV USER_NAME=vrserver
ENV GROUP_NAME=vrserver
USER vrserver:vrserver
# Setup environment variables for configuring the server
ENV V_RISING_SERVER_PERSISTENT_DATA_PATH "/app/vrising"
ENV V_RISING_SERVER_BRANCH "public"
ENV V_RISING_SERVER_START_MODE "0"
ENV V_RISING_SERVER_AUTO_UPDATE "0"
ENV V_RISING_APPLY_CUSTOM_SETTINGS: "1"
# Setup environment variables for customizing the server
ENV V_RISING_SERVER_NAME "V Rising Container Server"
ENV V_RISING_SERVER_DESCRIPTION "V Rising server running inside a container."
ENV V_RISING_SERVER_BIND_IP "127.0.0.1"
ENV V_RISING_SERVER_GAME_PORT 9876
ENV V_RISING_SERVER_QUERY_PORT 9877
ENV V_RISING_SERVER_RCON_PORT 9878
ENV V_RISING_SERVER_RCON_ENABLED true
ENV V_RISING_SERVER_RCON_PASSWORD "s3cr3t_rc0n_p455w0rd"
ENV V_RISING_SERVER_MAX_CONNECTED_USERS 40
ENV V_RISING_SERVER_MAX_CONNECTED_ADMINS 4
ENV V_RISING_SERVER_SAVE_NAME "docker"
ENV V_RISING_SERVER_PASSWORD ""
ENV V_RISING_SERVER_LIST_ON_MNASTER_SERVER true
ENV V_RISING_SERVER_AUTO_SAVE_COUNT 50
ENV V_RISING_SERVER_AUTO_SAVE_INTERVAL 600
ENV V_RISING_SERVER_GAME_SETTINGS_PRESET "StandardPvE"
# Expose the volumes
VOLUME [ "/steamcmd/vrising", "/app/vrising", "/home/vrserver/.wine" ]
# Start the server
CMD [ "bash", "/app/start.sh" ]