-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (32 loc) · 1.28 KB
/
Dockerfile
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
34
35
36
37
38
39
40
# syntax=docker/dockerfile:1.8@sha256:e87caa74dcb7d46cd820352bfea12591f3dba3ddc4285e19c7dcd13359f7cefd
FROM mcr.microsoft.com/dotnet/nightly/aspnet:7.0-jammy-chiseled@sha256:02e09bf8a723a8fcc313c65d9cf171bfde85e2beeeed67013a8e615ca84992fb AS runtime
WORKDIR /opt/magnifhir
EXPOSE 8080/tcp 8081/tcp
USER 65532:65532
ENV DOTNET_ENVIRONMENT="Production" \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
ASPNETCORE_URLS="http://+:8080;http://+:8081"
ENTRYPOINT ["dotnet", "/opt/magnifhir/magniFHIR.dll"]
FROM mcr.microsoft.com/dotnet/sdk:7.0-jammy@sha256:9db41721e58ac92cea1b5cbdb6080cd033a66a6f83521eaf0e1e561e9971efa7 AS build
WORKDIR /build
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
COPY magniFHIR.sln .
COPY src/magniFHIR/magniFHIR.csproj src/magniFHIR/magniFHIR.csproj
COPY src/magniFHIR.Tests/magniFHIR.Tests.csproj src/magniFHIR.Tests/magniFHIR.Tests.csproj
RUN dotnet restore magniFHIR.sln
COPY . .
RUN <<EOF
dotnet build src/magniFHIR/magniFHIR.csproj \
--no-restore \
--configuration=Release
dotnet publish src/magniFHIR/magniFHIR.csproj \
--no-restore \
--no-build \
--configuration=Release \
-o /build/publish
EOF
FROM build AS test
RUN dotnet test src/magniFHIR.Tests/magniFHIR.Tests.csproj \
--no-restore -p:CollectCoverage=true
FROM runtime
COPY --from=build /build/publish .