arm64 dockerfile

master
Tudor Stanciu 2022-06-18 10:50:11 +03:00
parent 4ba000d9b5
commit dd45b7e724
1 changed files with 42 additions and 0 deletions

View File

@ -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"]