Allow alternate config location for Docker (/data/sos_config.json)
This commit is contained in:
2
build.sh
2
build.sh
@@ -51,7 +51,7 @@ echo "Setting up Docker BuildX"
|
||||
docker buildx create --name mybuilder --use || true
|
||||
|
||||
echo "Building multi-platform Docker image"
|
||||
docker buildx build --load -t simple-object-storage:latest --platform linux/amd64,linux/arm64 .
|
||||
docker buildx build --push -t gitea.jde.nz/j/simple-object-storage:latest --platform linux/amd64,linux/arm64 .
|
||||
|
||||
echo "Build completed successfully!"
|
||||
|
||||
|
@@ -7,8 +7,13 @@
|
||||
namespace simple_object_storage {
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
std::filesystem::path config_path = std::filesystem::path(std::getenv("HOME")) / ".config/simple_object_storage/config.json";
|
||||
std::filesystem::create_directories(config_path.parent_path());
|
||||
|
||||
std::filesystem::path config_path = "/data/sos_config.json";
|
||||
if (!std::filesystem::exists(config_path))
|
||||
config_path = std::filesystem::path(std::getenv("HOME")) / ".config/simple_object_storage/config.json";
|
||||
|
||||
if (!std::filesystem::exists(config_path))
|
||||
std::filesystem::create_directories(config_path.parent_path());
|
||||
|
||||
ServerConfig config;
|
||||
if (!simple_object_storage::load_config(config_path, config)) {
|
||||
|
Reference in New Issue
Block a user