21 lines
502 B
Docker

############# DEV IMAGE #################
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch as dev
RUN mkdir /app/
WORKDIR /app/
COPY ./src/work.csproj /app/work.csproj
RUN dotnet restore
COPY ./src/ /app/
RUN mkdir /out/
RUN dotnet publish --no-restore --output /out/ --configuration Release
############## PRODUCT IMAGE #############
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch-slim as prod
RUN mkdir /app/
WORKDIR /app/
COPY --from=dev /out/ /app/
RUN chmod +x /app/
CMD dotnet work.dll