refactor: optimize Dockerfiles for quicker builds
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6af240c922
commit
60586f4d68
|
@ -0,0 +1,2 @@
|
|||
bin/
|
||||
obj/
|
13
Dockerfile
13
Dockerfile
|
@ -1,15 +1,14 @@
|
|||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-alpine
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
RUN dotnet --version && dotnet --info
|
||||
|
||||
COPY *.csproj ./
|
||||
RUN dotnet restore
|
||||
RUN dotnet clean
|
||||
RUN dotnet build -c Release
|
||||
|
||||
COPY . ./
|
||||
RUN dotnet build -c Release -o out
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:2.1
|
||||
|
||||
COPY --from=0 /src/bin/Release/netcoreapp2.1/publish/ App/
|
||||
WORKDIR /App
|
||||
COPY --from=0 /src/out .
|
||||
ENV ASPNETCORE_ENVIRONMENT=Release
|
||||
ENTRYPOINT ["dotnet", "pwt-0x01-ng.dll"]
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-alpine
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
|
||||
RUN dotnet --version && dotnet --info
|
||||
COPY *.csproj ./
|
||||
RUN dotnet restore
|
||||
RUN dotnet clean
|
||||
|
||||
COPY . ./
|
||||
RUN dotnet build -c Debug
|
||||
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
|
|
Reference in New Issue