Skip to content

Commit 0a81f78

Browse files
authored
move steamcmd from image to runtime (#7)
* move steamcmd from image to runtime * fix typo * add wget failsafe switches
1 parent 362bf63 commit 0a81f78

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# .dockerignore
2+
scumserver-data
3+
steamcmd

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
scumserver-data/
2+
steamcmd/

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,17 @@ ENV WINEDEBUG -all
2222
ENV WINEARCH win64
2323
ENV WINEPREFIX /opt/wine64
2424
ENV XDG_RUNTIME_DIR /tmp
25+
ENV PATH=/opt/steamcmd:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2526

2627
RUN wineboot --init
2728

28-
RUN mkdir -p /opt/steamcmd && cd /opt/steamcmd && wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz && tar -xvzf steamcmd_linux.tar.gz
29-
ENV PATH=/opt/steamcmd:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
30-
3129
# scum server run script
3230
COPY start-server.sh /opt/start-server.sh
3331
RUN chmod +x /opt/start-server.sh
3432

3533
# cleanup
3634
RUN apt-get clean
37-
RUN rm /opt/steamcmd/steamcmd_linux.tar.gz
35+
RUN rm -rf /var/lib/apt/lists/*
3836

3937
EXPOSE 27020/udp
4038
EXPOSE 27015/udp

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ services:
1616
- "27015:27015/tcp"
1717
volumes:
1818
- ./scumserver-data:/opt/scumserver
19+
- ./steamcmd:/opt/steamcmd
1920
restart: unless-stopped

start-server.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
#!/bin/bash
22
set -e
33

4-
echo "Installing/updating steamcmd and SCUM dedicated server..."
4+
# skip download of SteamCMD if present already
5+
if [ ! -f /opt/steamcmd/steamcmd.sh ]; then
6+
echo "SteamCMD not found. Installing..."
7+
mkdir -p /opt/steamcmd && \
8+
cd /opt/steamcmd && \
9+
wget --timeout=30 --tries=3 https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz && \
10+
tar -xvzf steamcmd_linux.tar.gz && \
11+
rm /opt/steamcmd/steamcmd_linux.tar.gz && \
12+
echo "SteamCMD successfully installed"
13+
else
14+
echo "SteamCMD found, skipping installation..."
15+
fi
16+
17+
echo "Update SteamCMD and SCUM dedicated server..."
518
/opt/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType windows \
619
+force_install_dir /opt/scumserver \
720
+login anonymous \

0 commit comments

Comments
 (0)