Files
UA-.NETStandard/SampleApplications/Workshop/Aggregation/ConsoleAggregationServer/Dockerfile
T
Erich Barnstedt c7fa0f1b5d Added debuggable Docker container definition. (#934)
Visual Studio 2017 and 2019 support debugging Docker containers. You need to install Docker for Windows for this to work, though, find it here: https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe.

This change adds a Docker container definition and the settings for Visual Studio to expose the containerized Aggregation server running on Linux through the default OPC UA port (62530).
2020-04-01 15:05:36 +02:00

26 lines
1.1 KiB
Docker

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["ConsoleAggregationServer/ConsoleAggregationServer.csproj", "ConsoleAggregationServer/"]
COPY ["../../SDK/Opc.Ua.Server/Opc.Ua.Server.csproj", "../../SDK/Opc.Ua.Server/"]
COPY ["../../../Stack/Opc.Ua.Core/Opc.Ua.Core.csproj", "../../../Stack/Opc.Ua.Core/"]
COPY ["../../SDK/Opc.Ua.Configuration/Opc.Ua.Configuration.csproj", "../../SDK/Opc.Ua.Configuration/"]
COPY ["../../SDK/Opc.Ua.Client/Opc.Ua.Client.csproj", "../../SDK/Opc.Ua.Client/"]
RUN dotnet restore "ConsoleAggregationServer/ConsoleAggregationServer.csproj"
COPY . .
WORKDIR "/src/ConsoleAggregationServer"
RUN dotnet build "ConsoleAggregationServer.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ConsoleAggregationServer.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
EXPOSE 62530
ENTRYPOINT ["dotnet", "ConsoleAggregationServer.dll"]