-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
23 lines (18 loc) · 893 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
WORKDIR /app
# Copy everything and build
COPY . .
RUN dotnet build ./src/Authentication/Altinn.Platform.Authentication.csproj -c Release -o app_output \
&& dotnet publish ./src/Authentication/Altinn.Platform.Authentication.csproj -c Release -r linux-x64 -o app_output --no-self-contained
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS final
EXPOSE 5040
WORKDIR /app
COPY --from=build /app/app_output .
COPY src/Persistance/Migration /app/Persistance/Migration
# 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.Platform.Authentication.dll"]