lodestone_core icon indicating copy to clipboard operation
lodestone_core copied to clipboard

Add Cargo Chef and UID/USER Configuration to Dockerfile

Open Madscientiste opened this issue 11 months ago • 0 comments

Description

This PR should fix #164 and introduces some improvements to the Dockerfile.

The addition of UID and USER configuration options fixes the permission errors caused when binding mounts directories. As now the image can be built with a custom UID and USER by running docker build --build-arg UID=4561 --build-arg USER=steve or setting args: in the docker-compose.yml file. I've seen other opensource projects giving the ability to also change the GID, but it has been left out for now as it wasn't a pressing requirement (ithink?).

Also managed to reduce Rust compile times from 20 minutes~ to 15 minutes~ using Cargo Chef. but it's worth noting that while it does bring some improvement, the results are not entirely consistent.

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

Note: make sure your files are formatted with rust-analyzer

Madscientiste avatar Jul 18 '23 10:07 Madscientiste