From dd45b7e7242d66fc074cac1fae770860e07b3ba1 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 18 Jun 2022 10:50:11 +0300 Subject: [PATCH] arm64 dockerfile --- .../Docker/arm64/Dockerfile | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/api/NetworkResurrector.Api/Docker/arm64/Dockerfile diff --git a/src/api/NetworkResurrector.Api/Docker/arm64/Dockerfile b/src/api/NetworkResurrector.Api/Docker/arm64/Dockerfile new file mode 100644 index 0000000..77b339f --- /dev/null +++ b/src/api/NetworkResurrector.Api/Docker/arm64/Dockerfile @@ -0,0 +1,42 @@ +#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-arm64v8 AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim-arm64v8 AS build +WORKDIR /src +COPY dependencies.props . +COPY Directory.Build.props . +COPY NuGet.config . +COPY ["src/api/NetworkResurrector.Api/NetworkResurrector.Api.csproj", "NetworkResurrector.Api/"] +COPY ["src/api/NetworkResurrector.Api.Application/NetworkResurrector.Api.Application.csproj", "NetworkResurrector.Api.Application/"] +COPY ["src/api/NetworkResurrector.Api.PublishedLanguage/NetworkResurrector.Api.PublishedLanguage.csproj", "NetworkResurrector.Api.PublishedLanguage/"] +COPY ["src/api/NetworkResurrector.Api.Domain/NetworkResurrector.Api.Domain.csproj", "NetworkResurrector.Api.Domain/"] +COPY ["src/api/NetworkResurrector.Api.Domain.Data/NetworkResurrector.Api.Domain.Data.csproj", "NetworkResurrector.Api.Domain.Data/"] +RUN dotnet restore "NetworkResurrector.Api/NetworkResurrector.Api.csproj" +COPY src/api . +WORKDIR "/src/NetworkResurrector.Api" +RUN dotnet build "NetworkResurrector.Api.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "NetworkResurrector.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***" +ENV IdentityServer__BaseAddress="http://***REMOVED***/" +ENV NetworkResurrectorServer__BaseAddress="http://***REMOVED***/" +ENV TZ=Europe/Bucharest +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +ARG APP_VERSION=0.0.0.0 +ENV APP_VERSION=${APP_VERSION} + +#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", "NetworkResurrector.Api.dll", "--console"] \ No newline at end of file