Switch from bind mounts to named docker volumes
This commit is contained in:
30
scripts/init_volumes.sh
Executable file
30
scripts/init_volumes.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Define a helper function that runs a command
|
||||
# If the command fails, the script prints an error message
|
||||
# and exits immediately.
|
||||
run() {
|
||||
# "$@" expands to all arguments passed to this function
|
||||
# and preserves proper word splitting and quoting.
|
||||
"$@" || {
|
||||
echo "Error: command failed: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Ensure required directories exist
|
||||
run mkdir -p /fabric_data/bluemap/web/maps
|
||||
run mkdir -p /fabric_data/config/worldedit/schematics
|
||||
run mkdir -p /paper_data/bluemap/web/maps
|
||||
run mkdir -p /paper_data/plugins/WorldEdit/schematics
|
||||
|
||||
# Ensure correct permissions of docker volumes
|
||||
run chown -R minecraft_server:minecraft_server /bluemap_data
|
||||
run chown -R minecraft_server:minecraft_server /bluemap_web
|
||||
run chown -R minecraft_server:minecraft_server /bluemap_maps
|
||||
run chown -R minecraft_server:minecraft_server /fabric_data
|
||||
run chown -R minecraft_server:minecraft_server /luckperms_data
|
||||
run chown -R minecraft_server:minecraft_server /paper_data
|
||||
run chown -R minecraft_server:minecraft_server /schematics
|
||||
run chown -R minecraft_server:minecraft_server /velocity_data
|
||||
|
||||
Reference in New Issue
Block a user