make data folder if not exist, updated Dockerfile so we no longer specify a specific port, we are now defaulting to 8080 for internal port

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-06 09:14:28 -07:00
parent af9c96c002
commit 0b05315671
2 changed files with 12 additions and 13 deletions

View File

@@ -1,18 +1,12 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
WORKDIR /App
COPY . ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
RUN mkdir -p /app/data
COPY --from=build-env /app/out .
EXPOSE 5000
ENTRYPOINT [ "dotnet", "CarCareTracker.dll" ]
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /App
COPY --from=build-env /App/out .
EXPOSE 8080
CMD ["./CarCareTracker"]

View File

@@ -17,6 +17,11 @@ builder.Services.AddSingleton<ICollisionRecordDataAccess, CollisionRecordDataAcc
builder.Services.AddSingleton<ITaxRecordDataAccess, TaxRecordDataAccess>();
builder.Services.AddSingleton<IFileHelper, FileHelper>();
if (!Directory.Exists("data"))
{
Directory.CreateDirectory("data");
}
//Additional JsonFile
builder.Configuration.AddJsonFile("userConfig.json", optional: true, reloadOnChange: true);