make it work !

This commit is contained in:
Thomas Fransolet 2023-04-24 17:26:20 +02:00
parent 69e86bfa26
commit 578b88cea2
4 changed files with 17 additions and 5 deletions

1
.gitignore vendored
View File

@ -56,3 +56,4 @@ ManagerService/bin
ManagerService/obj
ManagerService/resources
ManagerService/configurations
ManagerService/service-data

View File

@ -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");

View File

@ -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"]
RUN mkdir -p /app/service-data
ENTRYPOINT ["dotnet", "ManagerService.dll"]

View File

@ -6,6 +6,14 @@
<UserSecretsId>d2e1a747-e204-4b43-bf93-abbd19c46417</UserSecretsId>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;RELEASE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>$(DefineConstants)TRACE;RELEASE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.2" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.10.0" />