forked from Didstopia/rust-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
125 lines (101 loc) · 3.28 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
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
FROM didstopia/base:nodejs-12-steamcmd-ubuntu-18.04
LABEL maintainer="Didstopia <support@didstopia.com>"
# Fix apt-get warnings
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nginx \
expect \
tcl \
libsdl2-2.0-0:i386 \
libgdiplus && \
rm -rf /var/lib/apt/lists/*
# Remove default nginx stuff
RUN rm -fr /usr/share/nginx/html/* && \
rm -fr /etc/nginx/sites-available/* && \
rm -fr /etc/nginx/sites-enabled/*
# Install webrcon (specific commit)
COPY nginx_rcon.conf /etc/nginx/nginx.conf
RUN curl -sL https://github.com/Facepunch/webrcon/archive/24b0898d86706723d52bb4db8559d90f7c9e069b.zip | bsdtar -xvf- -C /tmp && \
mv /tmp/webrcon-24b0898d86706723d52bb4db8559d90f7c9e069b/* /usr/share/nginx/html/ && \
rm -fr /tmp/webrcon-24b0898d86706723d52bb4db8559d90f7c9e069b
# Customize the webrcon package to fit our needs
ADD fix_conn.sh /tmp/fix_conn.sh
# Create the volume directories
RUN mkdir -p /steamcmd/rust /usr/share/nginx/html /var/log/nginx
# Setup proper shutdown support
ADD shutdown_app/ /app/shutdown_app/
WORKDIR /app/shutdown_app
RUN npm install
# Setup restart support (for update automation)
ADD restart_app/ /app/restart_app/
WORKDIR /app/restart_app
RUN npm install
# Setup scheduling support
ADD scheduler_app/ /app/scheduler_app/
WORKDIR /app/scheduler_app
RUN npm install
# Setup scheduling support
ADD heartbeat_app/ /app/heartbeat_app/
WORKDIR /app/heartbeat_app
RUN npm install
# Setup rcon command relay app
ADD rcon_app/ /app/rcon_app/
WORKDIR /app/rcon_app
RUN npm install
RUN ln -s /app/rcon_app/app.js /usr/bin/rcon
# Add the steamcmd installation script
ADD install.txt /app/install.txt
# Copy the Rust startup script
ADD start_rust.sh /app/start.sh
# Copy the Rust update check script
ADD update_check.sh /app/update_check.sh
# Copy extra files
COPY README.md LICENSE.md /app/
# Set the current working directory
WORKDIR /
# Fix permissions
RUN chown -R 1000:1000 \
/steamcmd \
/app \
/usr/share/nginx/html \
/var/log/nginx
# Run as a non-root user by default
ENV PGID 1000
ENV PUID 1000
# Expose necessary ports
EXPOSE 8080
EXPOSE 28015
EXPOSE 28016
EXPOSE 28082
# Setup default environment variables for the server
ENV RUST_SERVER_STARTUP_ARGUMENTS "-batchmode -load -nographics +server.secure 1"
ENV RUST_SERVER_IDENTITY "docker"
ENV RUST_SERVER_PORT ""
ENV RUST_SERVER_QUERYPORT ""
ENV RUST_SERVER_SEED "12345"
ENV RUST_SERVER_NAME "Rust Server [DOCKER]"
ENV RUST_SERVER_DESCRIPTION "This is a Rust server running inside a Docker container!"
ENV RUST_SERVER_URL "https://hub.docker.com/r/didstopia/rust-server/"
ENV RUST_SERVER_BANNER_URL ""
ENV RUST_RCON_WEB "1"
ENV RUST_RCON_PORT "28016"
ENV RUST_RCON_PASSWORD "docker"
ENV RUST_APP_PORT "28082"
ENV RUST_UPDATE_CHECKING "0"
ENV RUST_HEARTBEAT "0"
ENV RUST_UPDATE_BRANCH "public"
ENV RUST_START_MODE "0"
ENV RUST_OXIDE_ENABLED "0"
ENV RUST_OXIDE_UPDATE_ON_BOOT "1"
ENV RUST_RCON_SECURE_WEBSOCKET "0"
ENV RUST_SERVER_WORLDSIZE "3500"
ENV RUST_SERVER_MAXPLAYERS "500"
ENV RUST_SERVER_SAVE_INTERVAL "600"
# Define directories to take ownership of
ENV CHOWN_DIRS "/app,/steamcmd,/usr/share/nginx/html,/var/log/nginx"
# Expose the volumes
# VOLUME [ "/steamcmd/rust" ]
# Start the server
CMD [ "bash", "/app/start.sh"]