-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from IvanJosipovic/dev
Harden Container Image
- Loading branch information
Showing
8 changed files
with
85 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build | ||
WORKDIR /src | ||
COPY ["ingress-nginx-validate-jwt/ingress-nginx-validate-jwt.csproj", "ingress-nginx-validate-jwt/"] | ||
RUN dotnet restore "ingress-nginx-validate-jwt/ingress-nginx-validate-jwt.csproj" | ||
COPY . . | ||
WORKDIR "/src/ingress-nginx-validate-jwt" | ||
RUN dotnet build "ingress-nginx-validate-jwt.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
ARG VERSION=0.0.1 | ||
RUN dotnet publish "ingress-nginx-validate-jwt.csproj" -c Release -r linux-musl-x64 -o /app/publish /p:Version=${VERSION} | ||
|
||
FROM mcr.microsoft.com/dotnet/runtime-deps:7.0-alpine AS base | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8443 | ||
ENV ASPNETCORE_URLS=http://+:8080;https://+:8443 | ||
|
||
RUN addgroup -g 2000 appgroup \ | ||
&& adduser -u 1000 -G appgroup -D "appuser" | ||
|
||
RUN chown appuser:appgroup /app | ||
USER appuser:appgroup | ||
|
||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["./ingress-nginx-validate-jwt"] |
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