34 lines
1.4 KiB
Docker
34 lines
1.4 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 ["IdentityServer.Api/IdentityServer.Api.csproj", "IdentityServer.Api/"]
|
|
COPY ["IdentityServer.Application/IdentityServer.Application.csproj", "IdentityServer.Application/"]
|
|
COPY ["IdentityServer.Domain/IdentityServer.Domain.csproj", "IdentityServer.Domain/"]
|
|
COPY ["IdentityServer.PublishedLanguage/IdentityServer.PublishedLanguage.csproj", "IdentityServer.PublishedLanguage/"]
|
|
COPY ["IdentityServer.Domain.Data/IdentityServer.Domain.Data.csproj", "IdentityServer.Domain.Data/"]
|
|
RUN dotnet restore "IdentityServer.Api/IdentityServer.Api.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/IdentityServer.Api"
|
|
RUN dotnet build "IdentityServer.Api.csproj" -c Release -o /app/build
|
|
|
|
FROM build AS publish
|
|
RUN dotnet publish "IdentityServer.Api.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", "IdentityServer.Api.dll"] |