use non-root user in containers
This commit is contained in:
parent
f1df8ae8c5
commit
e2291fb90e
@ -19,5 +19,10 @@ FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app ./
|
||||
ENV DOTNET_EnableDiagnostics=0
|
||||
|
||||
ARG DOCKER_USER=selector
|
||||
RUN addgroup -S $DOCKER_USER && adduser -S $DOCKER_USER -G $DOCKER_USER
|
||||
USER $DOCKER_USER
|
||||
|
||||
ENTRYPOINT ["dotnet", "Selector.CLI.dll"]
|
||||
|
||||
|
@ -30,4 +30,9 @@ EXPOSE 80
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app ./
|
||||
ENV DOTNET_EnableDiagnostics=0
|
||||
|
||||
ARG DOCKER_USER=selector
|
||||
RUN addgroup -S $DOCKER_USER && adduser -S $DOCKER_USER -G $DOCKER_USER
|
||||
USER $DOCKER_USER
|
||||
|
||||
ENTRYPOINT ["dotnet", "Selector.Web.dll"]
|
||||
|
Loading…
Reference in New Issue
Block a user