-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Update] Docker file and appsettings
- Loading branch information
samatrhea
committed
Mar 20, 2024
1 parent
d0d4400
commit 66d5507
Showing
3 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters