cicd
This commit is contained in:
28
PARR.API/Dockerfile
Normal file
28
PARR.API/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
#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
|
||||
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.DAL/PARR.DAL.csproj", "PARR.DAL/"]
|
||||
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
|
||||
|
||||
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 .
|
||||
Reference in New Issue
Block a user