Skip to content

Docker Reforger - Improvements to Base Image - #62

Merged
BrettMayson merged 12 commits into
acemod:mainfrom
AngriestBird:main
Jul 30, 2026
Merged

BrettMayson merged 12 commits into
acemod:mainfrom
AngriestBird:main

Conversation

@AngriestBird

@AngriestBird AngriestBird commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Security

  • SHA pins GitHub actions for better security practices
  • Upgrades base container from bullseye to bookworm due to EOL support

Stylization

  • Improved/fixed linting for the changes
  • Added dockerignore and more gitignore features
  • Restructured to src/ and test/ for Dockerfile source files and test/ files for easier long term work when working on things to add lightweight Dockerfile testing.

Additions/Features

  • Implements the remaining features for server configuration that were missing from 1.6 documentation for Server Configuration
  • Extended the README farther for more utilities and explanations
  • Simple healthcheck on the container to improve usability for users
  • New Feature: Ability to have the image auto-prune mods if you iterate on mod packs like I do (disabled by default)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the container base and hardens the project’s build/CI pipeline while expanding server configuration support by centralizing env→config generation logic and documenting the new options.

Changes:

  • Upgrade Docker base image to Debian bookworm and add a container healthcheck (A2S-based when enabled).
  • Refactor configuration generation into launch_config.py and add pytest coverage for env-driven config behavior.
  • Add/adjust CI + linting tooling (pinned GitHub Actions SHAs, new CI workflow, hadolint via pre-commit) and expand README documentation.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Dockerfile Upgrade base image, add new env knobs, and add HEALTHCHECK execution.
healthcheck.py Implements A2S_INFO-based health probing with config/env fallback.
launch.py Switches to centralized config builder and warms up SteamCMD before install.
launch_config.py New module encapsulating env-driven server config generation logic.
test_launch_config.py New pytest suite covering config generation behavior and validation.
README.md Documents new env vars (RCON/persistence/operating/mission header) and healthcheck behavior.
.github/workflows/ci.yaml Adds CI jobs for linting and running pytest.
.github/workflows/ghcr.yaml Pins action SHAs for supply-chain hardening.
.github/workflows/lint.yaml Removes the previous standalone lint workflow (replaced by ci.yaml).
.pre-commit-config.yaml Adds pre-commit hadolint hook configuration.
.hadolint.yaml Adds hadolint rule ignore configuration.
.dockerignore Reduces Docker build context (ignores git/GitHub metadata, docs, etc.).
.gitignore Ignores Python cache and additional local tooling directories.
scripts/build.sh Adds a helper script for building a local test image.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread launch_config.py Resolved
Comment thread launch_config.py Resolved
Comment thread launch_config.py Resolved
Comment thread launch_config.py Resolved
Comment thread launch.py Resolved
AngriestBird and others added 3 commits July 6, 2026 22:38
* Simplify launcher config handling

* Restore force-kill safety net on repeated shutdown signal

* Apply black formatting

* Fix isort import grouping in tests

* Bump setup-python to v6 (Node 24 runtime)

* Apply black formatting to healthcheck.py
Docker rejects uppercase repository names, so the publish job failed
tagging ghcr.io/AngriestBird/... . Compute the tag at runtime and
lowercase the owner via bash parameter expansion.
@AngriestBird

Copy link
Copy Markdown
Contributor Author

@BrettMayson I resolved the issues you posted and then fixed the linting issues.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.

Comment thread scripts/build.sh Resolved
Comment thread .hadolint.yaml Resolved
Comment thread launch_config.py Resolved
Comment thread launch_config.py Resolved
Comment thread launch_config.py Resolved
Comment thread healthcheck.py Resolved
Comment thread Dockerfile Resolved
@AngriestBird

Copy link
Copy Markdown
Contributor Author

Second batch of findings should be fixed.

@AngriestBird

Copy link
Copy Markdown
Contributor Author

@BrettMayson The findings have been fixed. Please review again when you have a moment.

* Add safe automatic workshop mod pruning

* Fixed the cleanup here

* Fix super-linter yamllint and derive GHCR image from repo

- Add .github/linters/.yaml-lint.yml (super-linter defaults plus
  truthy: check-keys: false) so the on: key no longer fails under
  YAML_ERROR_ON_WARNING.
- Publish job derives the image path from github.repository
  (ghcr.io/<owner>/<repo>) instead of a hardcoded arma-reforger name,
  so forks publish to their own owner/repo and upstream stays
  ghcr.io/acemod/docker-reforger. Publish still gated to main pushes
  and tags :latest plus :sha-<short>.
- Bump the CI test job to Python 3.14.

* Fix Python lint failures

* Fix lint suppressions and restructure into src/

The pylintrc disabled R0914, R0912 and R0915 and told pylint to ignore
pytest imports instead of fixing what they flagged. prune_mods is now
split into scan, retain, validate and delete helpers, and the env to
config mapping in build_config is table driven. Both are behavior
preserving. build_config was diffed against the old one across 3412 env
combinations with no divergence.

Linting only ever ran on changed files, so most of the repo was never
checked. Running it everywhere found an unencoded open() and a bare
except in healthcheck.py, plus four issues in the steam query script.

Also:
- Move app code to src/, copied to /app in the image
- Move tests to tests/ and add pruning and env mapping coverage
- Replace requirements-dev.txt with PEP 735 dependency groups
- Consolidate Python and hadolint config, one file each
- Run black, isort and pylint in the test job where the deps exist
- Fix ARMA_CONFIG docs, a custom config needs its .json extension

* Fix README terminology lint failure
Comment thread README.md Outdated
-e SERVER_PUBLIC_ADDRESS="public ip" \
-e GAME_NAME="My Docker Reforger Server" \
ghcr.io/acemod/arma-reforger:latest
ghcr.io/angriestbird/docker-reforger:latest

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well we can't merge this now

@AngriestBird AngriestBird Jul 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted that. That was me doing testing working that I was messing with. Sorry about that @BrettMayson!

It should be pushed and cleared provided I got them all.

I forgot I had this pending so merged some of the code I was working on as a suggestion piece. If we want to do split PRs, I am more than happy to do that as well. Please let me know.

Comment thread .github/workflows/ghcr.yaml Resolved
@AngriestBird

Copy link
Copy Markdown
Contributor Author

Fixed "" as requested. Re-tested image and worked as expected.

@BrettMayson
BrettMayson merged commit cd226c0 into acemod:main Jul 30, 2026
5 checks passed
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.

3 participants