Lodestone-Team / lodestone_core

The backend for Lodestone, A free, open source server hosting tool for Minecraft and other multiplayers
https://www.lodestone.cc/
GNU Affero General Public License v3.0
60 stars 6 forks source link

Add Cargo Chef and UID/USER Configuration to Dockerfile #178

Closed Madscientiste closed 4 weeks ago

Madscientiste commented 1 year ago

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

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