Skip to content

move steamcmd from image to runtime#7

Merged
EvilOlaf merged 3 commits intomainfrom
expose-steam
Nov 26, 2025
Merged

move steamcmd from image to runtime#7
EvilOlaf merged 3 commits intomainfrom
expose-steam

Conversation

@EvilOlaf
Copy link
Owner

@EvilOlaf EvilOlaf commented Nov 26, 2025

Addresses #2
Move steamcmd installation and update to runtime in order to speed up startup

  • Docker image would most likely ship outdated steamcmd, therefore it is updated at every startup
  • Having this installed at runtime chances are higher that steamcmd is actually up-to-date, thus skipping update
  • also reduces the overall image size
  • steamcmd directory is now exposed as compromise
  • introduce .dockerignore and .gitignore to make development work easier

Summary by CodeRabbit

  • Chores

    • Optimized container setup and startup sequence for faster, cleaner initialization.
    • Added ignore rules to reduce unneeded files in builds and repository.
  • New Features

    • Added conditional dependency installation so missing tooling is installed automatically.
    • Added explicit update/validation step for the game server before startup.
    • Mounted persistent tooling data into the container to persist updates.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 26, 2025

Walkthrough

Moves SteamCMD installation from image build to container runtime: removes build-time install from the Dockerfile, mounts ./steamcmd into /opt/steamcmd via docker-compose, adds .dockerignore/.gitignore entries, and makes start-server.sh conditionally install/update SteamCMD and run app_update ... validate before launching the server.

Changes

Cohort / File(s) Change Summary
Ignore files
\.dockerignore`, `.gitignore``
Added .dockerignore (ignores scumserver-data, steamcmd); added steamcmd/ to .gitignore.
Dockerfile
Dockerfile
Removed build-time SteamCMD creation/download/extract; added ENV PATH=/opt/steamcmd:...; added rm -rf /var/lib/apt/lists/* cleanup; removed duplicate PATH assignment.
Compose volume
docker-compose.yml
Added volume mapping ./steamcmd -> /opt/steamcmd for the scum-server service.
Startup script
start-server.sh
Replaced echo with conditional install of SteamCMD when missing (mkdir, download, extract, cleanup); added explicit app_update 3792580 validate invocation before starting the SCUM server.

Sequence Diagram

sequenceDiagram
    participant C as Container
    participant S as start-server.sh
    participant H as Host FS (./steamcmd)
    participant SC as SteamCMD

    C->>S: run start-server.sh
    S->>H: check /opt/steamcmd/steamcmd.sh
    alt missing
        S->>H: mkdir /opt/steamcmd
        S->>H: download steamcmd_linux.tar.gz
        S->>H: extract -> /opt/steamcmd
        S->>H: remove tarball
        S->>C: log "SteamCMD installed"
    else present
        S->>C: log "SteamCMD present, skipping install"
    end
    S->>SC: run "app_update 3792580 validate" && quit
    SC-->>S: update/validate result
    S->>C: exec SCUM server process
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review focus: start-server.sh conditional logic, error handling and idempotence around download/extract/update.
  • Verify Dockerfile PATH change and apt cleanup are correct.
  • Confirm docker-compose volume path and .gitignore/.dockerignore entries behave as intended.

Poem

🐇 I found a cmd in earth so deep,

I hid it safe where volumes sleep,
At start I peek—if missing, fetch and bake,
Update, validate, then off we wake,
Server hops alive; I nibble a celebratory carrot.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'move steamcmd from image to runtime' accurately captures the main architectural change across all modified files: removing steamcmd from the Docker image build and moving its installation/updates to container runtime.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch expose-steam

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 400030c and a09ce93.

📒 Files selected for processing (1)
  • start-server.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • start-server.sh

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 362bf63 and 1a6df63.

📒 Files selected for processing (5)
  • .dockerignore (1 hunks)
  • .gitignore (1 hunks)
  • Dockerfile (1 hunks)
  • docker-compose.yml (1 hunks)
  • start-server.sh (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (7)
.dockerignore (1)

1-3: Good practice for build context optimization.

Excluding runtime/mounted directories from the build context is appropriate and keeps the Docker build efficient.

.gitignore (1)

2-2: Appropriate ignore pattern for volume-mounted directory.

Excluding the steamcmd directory from version control is correct since it's now managed as a runtime volume.

docker-compose.yml (1)

17-19: Volume mount enables persistent SteamCMD caching.

The volume mount correctly provides a persistent location for steamcmd across container restarts. Note that if ./steamcmd doesn't exist on the host, Docker will create it; ensure appropriate permissions are set if running as non-root.

Dockerfile (2)

25-25: PATH correctly prioritizes mounted SteamCMD.

The PATH update ensures the runtime-installed steamcmd is used preferentially. This aligns with the volume mount strategy in docker-compose.yml.


34-35: Good image hygiene improvements.

Removing apt package lists after installation reduces the final image size without affecting runtime functionality.

start-server.sh (2)

17-22: SteamCMD update/validate sequence is correct.

The added validate flag on line 21 ensures the SCUM server app is properly validated after update, which is a good practice. The +quit on line 22 ensures steamcmd exits cleanly.


5-15: SteamCMD download URL is stable and aligns with official documentation.

The URL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz on line 9 matches the official SteamCMD Linux installation download URL as documented in official references. The use of HTTPS is the current recommended method for secure installation.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
start-server.sh (1)

4-15: Verify the SteamCMD installation persists correctly across restarts.

The conditional installation logic looks sound: it checks if /opt/steamcmd/steamcmd.sh exists and installs only if missing. However, ensure that:

  • The mounted volume ./steamcmd (from docker-compose.yml) has proper write permissions so the installation succeeds
  • The directory persists between container restarts (verify docker-compose volume mount configuration)
  • Partial downloads don't leave the directory in a broken state that would require manual cleanup

Consider adding a simple verification step after extraction to ensure steamcmd.sh is executable:

     tar -xvzf steamcmd_linux.tar.gz && \
+    chmod +x steamcmd.sh && \
     rm /opt/steamcmd/steamcmd_linux.tar.gz && \
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a6df63 and 400030c.

📒 Files selected for processing (1)
  • start-server.sh (1 hunks)

@EvilOlaf EvilOlaf merged commit 0a81f78 into main Nov 26, 2025
4 checks passed
@EvilOlaf EvilOlaf deleted the expose-steam branch November 26, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant