42 lines
1.6 KiB
Docker
42 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 10.99.253.167:8090/dotnet/aspnet:7.0 AS base
|
|
# CURL install (bullseye - for net core 7!!!)
|
|
RUN rm -f /etc/apt/sources.list.d/* && \
|
|
echo "deb [trusted=yes] http://10.99.253.167:8081/repository/apt-proxy bullseye main" > /etc/apt/sources.list && \
|
|
echo "deb [trusted=yes] http://10.99.253.167:8081/repository/apt-proxy bullseye-updates main" >> /etc/apt/sources.list && \
|
|
apt-get update && \
|
|
apt-get install -y curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
WORKDIR /app
|
|
EXPOSE 80
|
|
|
|
FROM 10.99.253.167:8090/dotnet/sdk:7.0 AS build
|
|
WORKDIR /src
|
|
COPY ["NuGet.config", "."]
|
|
COPY ["PARR.API/PARR.API.csproj", "PARR.API/"]
|
|
COPY ["PARR.BLL/PARR.BLL.csproj", "PARR.BLL/"]
|
|
COPY ["PARR.Common/PARR.Common.csproj", "PARR.Common/"]
|
|
COPY ["PARR.Domain/PARR.Domain.csproj", "PARR.Domain/"]
|
|
COPY ["PARR.Core/PARR.Core.csproj", "PARR.Core/"]
|
|
COPY ["PARR.DAL/PARR.DAL.csproj", "PARR.DAL/"]
|
|
COPY ["PARR.Infrastructure/PARR.Infrastructure.csproj", "PARR.Infrastructure/"]
|
|
RUN dotnet restore "PARR.API/PARR.API.csproj"
|
|
COPY . .
|
|
WORKDIR "/src/PARR.API"
|
|
RUN dotnet build "PARR.API.csproj" -c Release -o /app/build
|
|
|
|
FROM build AS publish
|
|
ARG app_version=0.0.0-default
|
|
RUN dotnet publish "PARR.API.csproj" -c Release -o /app/publish /p:UseAppHost=false /p:Version=$app_version
|
|
COPY --from=build /src/PARR.API/CHANGELOG.md /app/publish/wwwroot/
|
|
|
|
FROM base AS final
|
|
WORKDIR /app
|
|
COPY --from=publish /app/publish .
|
|
ENTRYPOINT ["dotnet", "PARR.API.dll"]
|
|
|
|
|
|
### EXAMPLE ###
|
|
# docker build -t parr-api:v1.0.0 --build-arg app_version=1.0.0 -f PARR.API/Dockerfile .
|