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:
20
Dockerfile
20
Dockerfile
@@ -1,18 +1,12 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
|
||||||
|
WORKDIR /App
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY *.csproj ./
|
|
||||||
RUN dotnet restore
|
|
||||||
|
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
RUN dotnet restore
|
||||||
RUN dotnet publish -c Release -o out
|
RUN dotnet publish -c Release -o out
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||||
WORKDIR /app
|
WORKDIR /App
|
||||||
RUN mkdir -p /app/data
|
COPY --from=build-env /App/out .
|
||||||
COPY --from=build-env /app/out .
|
EXPOSE 8080
|
||||||
|
CMD ["./CarCareTracker"]
|
||||||
EXPOSE 5000
|
|
||||||
|
|
||||||
ENTRYPOINT [ "dotnet", "CarCareTracker.dll" ]
|
|
||||||
@@ -17,6 +17,11 @@ builder.Services.AddSingleton<ICollisionRecordDataAccess, CollisionRecordDataAcc
|
|||||||
builder.Services.AddSingleton<ITaxRecordDataAccess, TaxRecordDataAccess>();
|
builder.Services.AddSingleton<ITaxRecordDataAccess, TaxRecordDataAccess>();
|
||||||
builder.Services.AddSingleton<IFileHelper, FileHelper>();
|
builder.Services.AddSingleton<IFileHelper, FileHelper>();
|
||||||
|
|
||||||
|
if (!Directory.Exists("data"))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory("data");
|
||||||
|
}
|
||||||
|
|
||||||
//Additional JsonFile
|
//Additional JsonFile
|
||||||
builder.Configuration.AddJsonFile("userConfig.json", optional: true, reloadOnChange: true);
|
builder.Configuration.AddJsonFile("userConfig.json", optional: true, reloadOnChange: true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user