Skip to content

General tidying, cleanup and optimisation #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

Laura7089
Copy link
Member

@Laura7089 Laura7089 commented Feb 15, 2021

Lots of changes here:

  • Hardcode several variables, including the game name, appid, and directory names.
    It wasn't really feasible to change any of these, so the image is simple with them just assumed.
    Port is hardcoded for simplicity and because docker allows port translation natively.
  • Expand the mount config and game update scripts out into their own files which are copied in instead of being dynamically generated.
    This helps general readability of the image and is possible with the above variables hardcoded.
  • Create a dedicated user which we have control over and pass a UID argument to change it's UID, allowing end users more fine grained control over directory permissions
  • Rejig directory structure to avoid home directories where possible, instead favouring root directories as these are simpler and more manageable
  • Shrink entrypoint script and have end users pass through gametype and default map themselves to allow finer control over the server; default to flatgrass to match the gmod client
  • Install CSS and TF2 content into the image during build, since these will almost certainly never need updating.
    This makes the image size a little more representative and means less messing about with runtime volumes is needed, plus the image will now start quicker (particularly the first time it's run).
  • Expand dockerignore
  • Update docker-compose file to match the changes, also use a named volume and a port forward instead of host networking and a bind mount.
    Host networking can be unpredictable as it exposes everything, whereas we know we only need the UDP 27015 port.
    Bind mount is not really necessary here as people are very unlikely to ever desire to modify gmod game files; named volume is tidier and still allows modification either through the image or the host system.
  • Remove references to fragsoc-specific workshop collections to allow end users to specify their own.
    If we want the collections mentioned in here, we could recommend them in the README?

Laura Demkowicz-Duffy added 11 commits February 15, 2021 15:09
Lots of changes here:
- Hardcode several variables since they can't really be changed anyway
- Add maintainer tags
- Use hardcoded scripts instead of generating dynamically, mostly for
  the sake of readability
- Allow more fine grained control over the map and gamemode by the end
  user
- Fix whitespacing
- Create a non-privileged user which we have control over
- Install CSS and TF2 during the build to try to optimise first-time
  start performance and to make image size at least slightly more
  predictable, we weren't updating these anyway
- Overhaul directory layout, removing everything from the home directory
Make entrypoint executable

Add home directory for gmod user so steamcmd works

Remove errant &&

Fix path in update script
…and reflect changes to the image

Correct docker-compose volume placement
Fix cfg path and steam path

Fix ~ expansion since it doesn't seem to work

Make sure the home directory created for the user corresponds to what we want
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