-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (40 loc) · 1.89 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
41
42
43
44
45
46
47
48
49
50
51
52
53
# kics false positive "Missing User Instruction": <https://docs.kics.io/latest/queries/dockerfile-queries/fd54f200-402c-4333-a5a4-36ef6709af2f/>
# kics-scan ignore-line
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0.0-noble-chiseled@sha256:38a284add1735bc68b855431ba9fa6b19e0f0dae7420706b963920ac070bf656 AS runtime
WORKDIR /opt/fhir-server-exporter
EXPOSE 9797/tcp
USER 65532:65532
ENV ASPNETCORE_ENVIRONMENT="Production" \
DOTNET_CLI_TELEMETRY_OPTOUT=1 \
ASPNETCORE_URLS="http://*:9797" \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0.101-noble@sha256:1f13e67d295e02abdfd187c341f887442bad611eda536766172ced401fc8b9fa AS build
WORKDIR "/build"
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
COPY src/Directory.Build.props ./src/
COPY src/FhirServerExporter/FhirServerExporter.csproj ./src/FhirServerExporter/
COPY src/FhirServerExporter/packages.lock.json ./src/FhirServerExporter/
RUN dotnet restore --locked-mode /p:ContinuousIntegrationBuild=true src/FhirServerExporter/FhirServerExporter.csproj
COPY . .
RUN dotnet build src/FhirServerExporter/FhirServerExporter.csproj \
--no-restore \
--configuration Release
RUN dotnet publish src/FhirServerExporter/FhirServerExporter.csproj \
--no-restore \
--no-build \
--configuration Release \
-o /build/publish
FROM build AS test
WORKDIR /build
COPY src/Directory.Build.props ./src/
COPY src/FhirServerExporter.Tests/FhirServerExporter.Tests.csproj ./src/FhirServerExporter.Tests/
RUN dotnet restore --locked-mode src/FhirServerExporter.Tests/FhirServerExporter.Tests.csproj
WORKDIR /build/src/FhirServerExporter.Tests
RUN dotnet test \
--configuration=Release \
--collect:"XPlat Code Coverage" \
--results-directory=./coverage \
-l "console;verbosity=detailed"
FROM runtime
COPY --from=build /build/publish .
ENTRYPOINT ["dotnet", "FhirServerExporter.dll"]