chatbot/Chatbot.Api/Dockerfile

39 lines
1.4 KiB
Docker
Raw Normal View History

2020-06-07 04:25:41 +03:00
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2022-09-03 11:12:05 +03:00
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
2020-06-07 04:25:41 +03:00
WORKDIR /app
EXPOSE 80
2022-09-03 11:12:05 +03:00
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
2020-06-07 04:25:41 +03:00
WORKDIR /src
COPY dependencies.props .
COPY Directory.Build.props .
2020-12-25 01:46:49 +02:00
COPY NuGet.config .
2020-06-07 04:25:41 +03:00
COPY ["Chatbot.Api/Chatbot.Api.csproj", "Chatbot.Api/"]
COPY ["Chatbot.Api.Domain.Data/Chatbot.Api.Domain.Data.csproj", "Chatbot.Api.Domain.Data/"]
COPY ["Chatbot.Api.Domain/Chatbot.Api.Domain.csproj", "Chatbot.Api.Domain/"]
COPY ["Chatbot.Api.Application/Chatbot.Api.Application.csproj", "Chatbot.Api.Application/"]
RUN dotnet restore "Chatbot.Api/Chatbot.Api.csproj"
COPY . .
WORKDIR "/src/Chatbot.Api"
RUN dotnet build "Chatbot.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Chatbot.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV urls="http://*:80"
2020-06-07 04:28:17 +03:00
ENV ConnectionStrings__DatabaseConnection="***REMOVED***"
ENV TZ=Europe/Bucharest
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2020-06-07 04:25:41 +03:00
2022-09-03 11:12:05 +03:00
ARG APP_VERSION=0.0.0.0
ENV APP_VERSION=${APP_VERSION}
2020-06-07 14:32:46 +03: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-06-07 04:25:41 +03:00
ENTRYPOINT ["dotnet", "Chatbot.Api.dll", "--docker"]