Skip to content

Commit

Permalink
[Update] Docker file and appsettings
Browse files Browse the repository at this point in the history
  • Loading branch information
samatrhea committed Mar 20, 2024
1 parent d0d4400 commit 66d5507
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
22 changes: 16 additions & 6 deletions reqifviewer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# syntax=docker/dockerfile:1.4

WORKDIR /src
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

COPY Nuget.Config .
COPY reqifviewer reqifviewer
RUN dotnet restore --configfile Nuget.Config reqifviewer
RUN dotnet build --no-restore reqifviewer -c Release -o /app/build

RUN dotnet build "reqifviewer/reqifviewer.csproj" -c Release -o /app/build --no-restore

FROM build AS publish
RUN dotnet publish reqifviewer -c Release -o /app/publish

FROM nginx:alpine AS final
WORKDIR /usr/share/nginx/html
COPY --from=publish /app/publish/wwwroot .
COPY reqifviewer/nginx.conf /etc/nginx/nginx.conf
FROM mcr.microsoft.com/dotnet/aspnet:8.0.3-alpine3.19 AS final

WORKDIR /app
RUN mkdir /app/logs

COPY --from=publish /app/publish .

# Create a non-root user and give this user access to the working directory
RUN chown -R $APP_UID /app
USER $APP_UID

ENTRYPOINT ["dotnet", "reqifviewer.dll"]
8 changes: 1 addition & 7 deletions reqifviewer/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"Kestrel": {
"Endpoints": {
"MyHttpEndpoint": {
"Url": "http://localhost:5000"
}
}
},
"AllowedHosts": "*",
"Serilog": {
"Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
"MinimumLevel": {
Expand Down
2 changes: 1 addition & 1 deletion reqifviewer/reqifviewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Application">
<Title>reqifviewer</Title>
<Version>0.18.0</Version>
<Version>1.0.0</Version>
<Description>Web Application to inspect ReqIF files</Description>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
Expand Down

0 comments on commit 66d5507

Please sign in to comment.