Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (30 loc) · 1.51 KB
/
Copy pathDockerfile
File metadata and controls
33 lines (30 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
WORKDIR /src
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1 NUGET_XMLDOC_MODE=skip
COPY Fincheck.sln ./
COPY src/Fincheck.Domain/Fincheck.Domain.csproj src/Fincheck.Domain/
COPY src/Fincheck.Shared/Fincheck.Shared.csproj src/Fincheck.Shared/
COPY src/Fincheck.Application/Fincheck.Application.csproj src/Fincheck.Application/
COPY src/Fincheck.Infrastructure/Fincheck.Infrastructure.csproj src/Fincheck.Infrastructure/
COPY src/Fincheck.Web/Fincheck.Web.csproj src/Fincheck.Web/
RUN dotnet restore src/Fincheck.Web/Fincheck.Web.csproj
COPY src/Fincheck.Domain/ src/Fincheck.Domain/
COPY src/Fincheck.Shared/ src/Fincheck.Shared/
COPY src/Fincheck.Application/ src/Fincheck.Application/
COPY src/Fincheck.Infrastructure/ src/Fincheck.Infrastructure/
COPY src/Fincheck.Web/ src/Fincheck.Web/
RUN dotnet publish src/Fincheck.Web/Fincheck.Web.csproj -c Release -o /app/publish /p:UseAppHost=false --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS runtime
WORKDIR /app
RUN apk add --no-cache icu-libs curl && adduser -D -u 10001 appuser
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \
DOTNET_EnableDiagnostics=0 \
ASPNETCORE_URLS=http://+:8080 \
ASPNETCORE_ENVIRONMENT=Production
COPY --from=build /app/publish .
RUN mkdir -p /app/Data /app/Data/dp-keys && chown -R appuser:appuser /app
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=5 \
CMD curl -fsS http://127.0.0.1:8080/ || exit 1
ENTRYPOINT ["dotnet", "Fincheck.Web.dll"]