|
1 |
| -FROM steamcmd/steamcmd AS steambuild |
2 |
| -# REPO_SETUP: Add maintainers |
| 1 | +FROM fragsoc/steamcmd-wine-xvfb |
| 2 | +# Maintainer: Laura Demkowicz-Duffy <[email protected]> |
3 | 3 |
|
4 | 4 | ARG UID=999
|
5 | 5 | ARG GID=999
|
6 | 6 |
|
7 | 7 | ENV CONFIG_LOC="/config"
|
8 |
| -ENV INSTALL_LOC="/GAME_NAME" |
| 8 | +ENV LOG_LOC="/logs" |
| 9 | +ENV INSTALL_LOC="/carriercommand" |
9 | 10 | ENV HOME=${INSTALL_LOC}
|
10 | 11 | ENV DEBIAN_FRONTEND="noninteractive"
|
11 | 12 |
|
12 | 13 | USER root
|
13 | 14 |
|
14 |
| -# REPO_SETUP: Append any packages that your server needs to the |
15 |
| -# REPO_SETUP: `apt install` line. |
16 | 15 | RUN apt update && \
|
17 | 16 | # Install libsdl, used by steamcmd
|
18 |
| - apt install -y --no-install-recommends libsdl2-2.0-0 |
| 17 | + apt install -y --no-install-recommends libsdl2-2.0-0 winbind |
19 | 18 |
|
20 | 19 | # Setup directory structure and user permissions
|
21 | 20 | RUN mkdir -p $INSTALL_LOC && \
|
22 |
| - groupadd -g $GID GAME_NAME && \ |
23 |
| - useradd -m -s /bin/false -u $UID -g $GID GAME_NAME && \ |
24 |
| - mkdir -p $CONFIG_LOC $INSTALL_LOC && \ |
25 |
| - chown -R GAME_NAME:GAME_NAME $INSTALL_LOC $CONFIG_LOC |
26 |
| - |
27 |
| -USER GAME_NAME |
28 |
| - |
29 |
| -# REPO_SETUP: You might consider installing steam appid 1007 ("+app_update 1007 validate \") |
30 |
| -# REPO_SETUP: alongside your game here if your game needs the steam libraries |
31 |
| -# REPO_SETUP: to appear in the server browser etc. |
32 |
| - |
33 |
| -# REPO_SETUP: If your game is windows only, you *might* be able to run it inside a linux container |
34 |
| -# REPO_SETUP: with wine and xvfb-run. If so, add a "+@sSteamCmdForcePlatformType windows \" |
35 |
| -# REPO_SETUP: line to this steamcmd command, and install xvfb and wine. |
36 |
| -# REPO_SETUP: Alternatively, see https://github.com/FragSoc/steamcmd-wine-xvfb-docker; |
37 |
| -# REPO_SETUP: you can use this as the base image for this template if you want :) |
38 |
| -# REPO_SETUP: (you'll still need that that platform force steamcmd command) |
39 |
| - |
40 |
| -# Install the GAME_NAME server |
41 |
| -# REPO_SETUP: Get the appid of the dedicated server from steamdb or similar |
42 |
| -ARG APPID=<YOUR APPID HERE> |
43 |
| -ARG STEAM_BETA |
44 |
| -RUN steamcmd \ |
45 |
| - +login anonymous \ |
46 |
| - +force_install_dir $INSTALL_LOC \ |
47 |
| - +app_update $APPID $STEAM_BETA validate \ |
48 |
| - +quit && \ |
49 |
| - # REPO_SETUP: you will probably want to symlink the game's default config directory |
50 |
| - # REPO_SETUP: to $CONFIG_LOC here |
| 21 | + groupadd -g $GID carriercommand && \ |
| 22 | + useradd -m -s /bin/false -u $UID -g $GID carriercommand |
| 23 | + |
| 24 | +# Install the carriercommand server |
| 25 | +ARG APPID=1489630 |
| 26 | +ARG STEAM_BETA="" |
| 27 | +COPY ./game_files $INSTALL_LOC |
| 28 | +COPY ./docker-entrypoint.sh /entrypoint.sh |
| 29 | +COPY ./healthcheck.sh /healthcheck.sh |
| 30 | +RUN chown -R carriercommand:carriercommand $INSTALL_LOC && \ |
| 31 | + chmod +x /entrypoint.sh /healthcheck.sh && \ |
| 32 | + ln -s $CONFIG_LOC/server_config.xml $INSTALL_LOC/server_config.xml |
51 | 33 |
|
52 | 34 | # I/O
|
53 |
| -VOLUME $CONFIG_LOC |
54 |
| -# REPO_SETUP: Add any ports you might need. Don't forget to append with /udp if necessary |
| 35 | +VOLUME $CONFIG_LOC $LOG_LOC |
| 36 | +# We can't do arithmetic here so the ports are hardcoded :( |
| 37 | +EXPOSE 25565/udp 25566/udp 25567/udp |
55 | 38 |
|
56 | 39 | # Expose and run
|
57 |
| -USER GAME_NAME |
| 40 | +USER carriercommand |
58 | 41 | WORKDIR $INSTALL_LOC
|
59 |
| -# REPO_SETUP: Add an entrypoint for the game |
| 42 | +HEALTHCHECK CMD /healthcheck.sh |
| 43 | +ENTRYPOINT ["tini", "--", "/entrypoint.sh"] |
0 commit comments