diff --git a/.gitignore b/.gitignore index e0ce730..597f3b8 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ ManagerService/bin ManagerService/obj ManagerService/resources ManagerService/configurations +ManagerService/service-data diff --git a/ManagerService/Controllers/ConfigurationController.cs b/ManagerService/Controllers/ConfigurationController.cs index 3e9b4d9..5e6a34e 100644 --- a/ManagerService/Controllers/ConfigurationController.cs +++ b/ManagerService/Controllers/ConfigurationController.cs @@ -300,11 +300,13 @@ namespace ManagerService.Controllers string currentDirectory = System.IO.Directory.GetCurrentDirectory(); Console.WriteLine($"currentDirectory: {currentDirectory}"); -#if RELEASE - Console.WriteLine($"currentDirectory: {Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}"); - //currentDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "service-data"); - currentDirectory = Path.Combine("/home", "debian", "service-data"); + currentDirectory = Path.Combine(currentDirectory, "service-data"); System.IO.Directory.CreateDirectory(currentDirectory.ToString()); + Console.WriteLine($"createdDiretory: {currentDirectory}"); +#if RELEASE + //Console.WriteLine($"currentDirectory: {Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}"); + //currentDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "service-data"); + #endif var resourcesDirectory = Path.Combine(currentDirectory, "resources"); diff --git a/ManagerService/Dockerfile b/ManagerService/Dockerfile index 8823fc1..8335b89 100644 --- a/ManagerService/Dockerfile +++ b/ManagerService/Dockerfile @@ -22,4 +22,5 @@ RUN dotnet publish "ManagerService.csproj" -c Release -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "ManagerService.dll"] \ No newline at end of file +RUN mkdir -p /app/service-data +ENTRYPOINT ["dotnet", "ManagerService.dll"] diff --git a/ManagerService/ManagerService.csproj b/ManagerService/ManagerService.csproj index e809caa..6a3be6b 100644 --- a/ManagerService/ManagerService.csproj +++ b/ManagerService/ManagerService.csproj @@ -6,6 +6,14 @@ d2e1a747-e204-4b43-bf93-abbd19c46417 + + $(DefineConstants)TRACE;RELEASE + + + + $(DefineConstants)TRACE;RELEASE + +