-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfee80f
commit 6766f4d
Showing
1 changed file
with
5 additions
and
16 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,23 +1,12 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build | ||
WORKDIR /app | ||
WORKDIR /src | ||
COPY src/ . | ||
WORKDIR /src/apps/Altinn.AccessManagement/src/Altinn.AccessManagement | ||
RUN dotnet publish -c Release -o /app | ||
|
||
# Copy everything and build | ||
COPY . . | ||
RUN dotnet restore | ||
|
||
# Copy everything else and build | ||
RUN dotnet publish -c Release -o out ./src/Altinn.AccessManagement/Altinn.AccessManagement.csproj | ||
|
||
# Build runtime image | ||
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final | ||
EXPOSE 5110 | ||
WORKDIR /app | ||
COPY --from=build /app/out . | ||
COPY --from=build /app . | ||
|
||
# setup the user and group | ||
# the user will have no password, using shell /bin/false and using the group dotnet | ||
RUN addgroup -g 3000 dotnet && adduser -u 1000 -G dotnet -D -s /bin/false dotnet | ||
# update permissions of files if neccessary before becoming dotnet user | ||
USER dotnet | ||
RUN mkdir /tmp/logtelemetry | ||
ENTRYPOINT ["dotnet", "Altinn.AccessManagement.dll"] |