RBLNews/IaC/RBLNews.Web/Dockerfile
iTob 95d5d4c39c
Some checks failed
Restart Docker Container on Production / build (pull_request) Failing after 41s
fix dockerfile
2024-09-20 22:45:11 +02:00

33 lines
1.1 KiB
Docker

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 8080
EXPOSE 443
ARG docker_external_http_port
ENV ASPNETCORE_URLS=http://+:docker_external_http_port
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["../../RBLNews.Web/RBLNews.Web.csproj", "RBLNews.Web/"]
COPY ["../../RBLNews.Shared/RBLNews.Shared.csproj", "RBLNews.Shared/"]
RUN dotnet nuget add source --name itob https://git.wohlleben.dev/api/packages/itob/nuget/index.json
RUN dotnet restore "RBLNews.Web/RBLNews.Web.csproj"
COPY . .
WORKDIR "/src/RBLNews.Web"
RUN dotnet build "RBLNews.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "RBLNews.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
# set time zone
RUN apt-get update && apt-get install -y tzdata
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENTRYPOINT ["dotnet", "RBLNews.Web.dll"]