network-resurrector/NetworkResurrector.Agent/Dockerfile

34 lines
1.5 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/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY dependencies.props .
COPY Directory.Build.props .
COPY NuGet.config .
COPY ["NetworkResurrector.Agent/NetworkResurrector.Agent.csproj", "NetworkResurrector.Agent/"]
COPY ["NetworkResurrector.Agent.Application/NetworkResurrector.Agent.Application.csproj", "NetworkResurrector.Agent.Application/"]
COPY ["NetworkResurrector.Agent.Domain/NetworkResurrector.Agent.Domain.csproj", "NetworkResurrector.Agent.Domain/"]
COPY ["NetworkResurrector.Agent.Domain.Data/NetworkResurrector.Agent.Domain.Data.csproj", "NetworkResurrector.Agent.Domain.Data/"]
RUN dotnet restore "NetworkResurrector.Agent/NetworkResurrector.Agent.csproj"
COPY . .
WORKDIR "/src/NetworkResurrector.Agent"
RUN dotnet build "NetworkResurrector.Agent.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "NetworkResurrector.Agent.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV urls="http://*:80"
ENV ConnectionStrings__DatabaseConnection="***REMOVED***"
#Workaround to lower the TLS level in container for old sql server version
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
ENTRYPOINT ["dotnet", "NetworkResurrector.Agent.dll", "--console"]