FROM microsoft/dotnet:latest AS publish
WORKDIR /src
COPY ./src/DemoService/ .
WORKDIR ./src/DemoService.Migrator
RUN dotnet restore
RUN dotnet publish -c Release -o /app
COPY ..
FROM publish AS final
WORKDIR /app
COPY ..
ENTRYPOINT ["dotnet", "DemoService.Migrator.dll"]
WebHost
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY ./src .
WORKDIR ./src/DemoService.Web.Host
RUN dotnet restore
RUN dotnet publish -c Release -o /app
FROM microsoft/dotnet:2.2-aspnetcore-runtime AS publish
WORKDIR /app
FROM publish AS final
WORKDIR /app
COPY --from=build /app .
ENTRYPOINT ["dotnet", "DemoService.Web.Host.dll"]
WEB Dockerfile
FROM node AS builder
WORKDIR /web
COPY ./src/Web/DemoWeb .
RUN npm i
RUN npm run build
FROM nginx AS final
WORKDIR /usr/share/nginx/html
COPY --from=builder ./web/dist/. /usr/share/nginx/html
COPY --from=builder ./web/nginx.conf /etc/nginx