37 lines
1.6 KiB
Docker
37 lines
1.6 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/aspnet:5.0-buster-slim AS base
|
|
WORKDIR /app
|
|
EXPOSE 80
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
|
|
WORKDIR /src
|
|
COPY dependencies.props .
|
|
COPY Directory.Build.props .
|
|
COPY NuGet.config .
|
|
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="*********************************"
|
|
ENV TZ=Europe/Bucharest
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
|
|
#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", "--console"] |