update dockerfile + add projects

This commit is contained in:
David Claeys
2025-11-28 13:21:38 +01:00
parent 6ca0511c8f
commit 62ae6b42e9
5 changed files with 34 additions and 10 deletions

View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.11" />
</ItemGroup>
</Project>

View File

@@ -1,10 +1,12 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.35828.75 d17.13
VisualStudioVersion = 17.13.35828.75
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TideFin.Server", "TideFin.Server\TideFin.Server.csproj", "{A490AE24-F8ED-46CB-9E86-3F22468485E9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TideFin.Server.DB", "TideFin.Server.DB\TideFin.Server.DB.csproj", "{1E198C8A-93EB-47F0-9D59-E14A0AF3260A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -15,6 +17,10 @@ Global
{A490AE24-F8ED-46CB-9E86-3F22468485E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A490AE24-F8ED-46CB-9E86-3F22468485E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A490AE24-F8ED-46CB-9E86-3F22468485E9}.Release|Any CPU.Build.0 = Release|Any CPU
{1E198C8A-93EB-47F0-9D59-E14A0AF3260A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E198C8A-93EB-47F0-9D59-E14A0AF3260A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E198C8A-93EB-47F0-9D59-E14A0AF3260A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E198C8A-93EB-47F0-9D59-E14A0AF3260A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -4,7 +4,7 @@ COPY . ./
# Restore dependencies for your application
RUN dotnet restore
# Build your application
RUN dotnet publish TideFin.Server --no-restore --self-contained false -c Release -o out /p:UseAppHost=false
RUN dotnet publish TideFin.Server.csproj --no-restore --self-contained false -c Release -o out /p:UseAppHost=false
FROM git.claeyscloud.com/david/net-base:9.0.11-alpine-22
@@ -12,6 +12,8 @@ WORKDIR /App
# copy build files from build-stage
COPY --from=build-env /App/out .
# change ownership of files to the app user
RUN chown -R app:app /App/
RUN chown -R app:app /App/*
# entrypoint for image
ENTRYPOINT ["dotnet", "TideFin.Server.dll"]
EXPOSE 80
EXPOSE 443

View File

@@ -7,14 +7,13 @@ builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Logging.ClearProviders();
builder.Logging.AddConsole();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();

View File

@@ -2,6 +2,9 @@
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Version>0.0.1</Version>
<AssemblyVersion>0.0.1</AssemblyVersion>
<FileVersion>0.0.1</FileVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>c40713b7-7556-4b39-b57c-0abf905d7931</UserSecretsId>