-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (20 loc) · 829 Bytes
/
Dockerfile
File metadata and controls
32 lines (20 loc) · 829 Bytes
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
ARG PROJECT_NAME=OpenFTTH.AddressChangeIndexer
ARG DOTNET_VERSION=8.0
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS build-env
# Renew the ARG argument for it to be available in this build context.
ARG PROJECT_NAME
WORKDIR /app
COPY ./*sln ./
COPY ./src/${PROJECT_NAME}/*.csproj ./src/${PROJECT_NAME}/
COPY ./test/${PROJECT_NAME}.Tests/*.csproj ./test/${PROJECT_NAME}.Tests/
RUN dotnet restore --packages ./packages
COPY . ./
WORKDIR /app/src/${PROJECT_NAME}
RUN dotnet publish -c Release -o out --packages ./packages
# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime:${DOTNET_VERSION}
# Renew the ARG argument for it to be available in this build context.
ARG PROJECT_NAME
WORKDIR /app
COPY --from=build-env /app/src/${PROJECT_NAME}/out .
ENTRYPOINT ["dotnet", "OpenFTTH.AddressChangeIndexer.dll"]