Files
hrm_eva/Dockerfile
Nakorn Rientrakrunchai 8b98125e49 First Initial
2020-02-20 15:02:39 +07:00

21 lines
529 B
Docker

FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out
ENV ASPNETCORE_ENVIRONMENT=Staging
RUN ["dotnet","ef","database","update"]
# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2
WORKDIR /app
COPY --from=build-env /app/out .
COPY --from=build-env /app/tb320eva.xml .
ENTRYPOINT ["dotnet", "tb320eva.dll", "--environment=Staging"]