diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index cbbe21b..af8615b 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -55,6 +55,11 @@ namespace CarCareTracker.Controllers { try { + if (!System.IO.File.Exists("config/userConfig.json")) + { + //if file doesn't exist it might be because it's running on a mounted volume in docker. + System.IO.File.WriteAllText("config/userConfig.json", System.Text.Json.JsonSerializer.Serialize(new UserConfig())); + } var configFileContents = System.IO.File.ReadAllText("config/userConfig.json"); var existingUserConfig = System.Text.Json.JsonSerializer.Deserialize(configFileContents); if (existingUserConfig is not null) diff --git a/docker-compose.yml b/docker-compose.yml index 81df8a7..e9b2e61 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,12 +21,7 @@ services: volumes: config: - external: true data: - external: true documents: - external: true images: - external: true log: - external: true