29 lines
697 B
Docker
Raw Normal View History

2020-12-08 13:54:06 +11:00
############# 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/
2021-01-27 23:42:53 +11:00
RUN dotnet publish --output /out/ --configuration Release
############# DEBUG IMAGE ################
FROM dev as debug
RUN apt-get update
RUN apt-get install -y unzip
RUN curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -l ~/vsdbg
RUN dotnet run
2020-12-08 13:54:06 +11:00
############## 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