-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
25 lines (21 loc) · 894 Bytes
/
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
ARG runtime_base_tag=2.1-runtime-alpine
ARG build_base_tag=2.1-sdk-alpine
FROM microsoft/dotnet:${build_base_tag} AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY iot-edge-opc-publisher-testserver/*.csproj ./iot-edge-opc-publisher-testserver/
WORKDIR /app/iot-edge-opc-publisher-testserver
RUN dotnet restore
# copy and publish app
WORKDIR /app
COPY iot-edge-opc-publisher-testserver/. ./iot-edge-opc-publisher-testserver/
COPY Server/. ./Server/
WORKDIR /app/iot-edge-opc-publisher-testserver
RUN dotnet publish -c Release -o out
# start it up
FROM microsoft/dotnet:${runtime_base_tag} AS runtime
WORKDIR /app
COPY --from=build /app/iot-edge-opc-publisher-testserver/out ./
WORKDIR /appdata
COPY --from=build /app/iot-edge-opc-publisher-testserver/Quickstarts.ReferenceServer.Config.xml /appdata
ENTRYPOINT ["dotnet", "/app/iot-edge-opc-publisher-testserver.dll"]