2020-12-25 01:17:36 +02:00
|
|
|
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
|
|
|
|
2022-02-10 16:12:46 +02:00
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
|
2020-12-25 01:17:36 +02:00
|
|
|
WORKDIR /app
|
|
|
|
EXPOSE 80
|
|
|
|
|
2022-02-10 16:12:46 +02:00
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
|
2020-12-25 01:17:36 +02:00
|
|
|
WORKDIR /src
|
|
|
|
COPY dependencies.props .
|
|
|
|
COPY Directory.Build.props .
|
2020-12-25 02:33:35 +02:00
|
|
|
COPY NuGet.config .
|
2020-12-25 01:17:36 +02:00
|
|
|
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***"
|
2021-12-05 23:31:00 +02:00
|
|
|
ENV TZ=Europe/Bucharest
|
|
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
2020-12-25 01:17:36 +02:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
2020-12-25 03:03:23 +02:00
|
|
|
ENTRYPOINT ["dotnet", "IdentityServer.Api.dll", "--console"]
|