Dockerfile 635 B

123456789101112131415161718192021
  1. # Stage 1 - Restoring & Compiling
  2. FROM microsoft/dotnet:2.2-sdk-alpine3.8 as builder
  3. WORKDIR /source
  4. RUN apk add --update nodejs nodejs-npm
  5. COPY *.csproj .
  6. RUN dotnet restore
  7. COPY package.json .
  8. RUN npm install
  9. COPY . .
  10. RUN dotnet publish -c Release -o /app/
  11. # Stage 2 - Creating Image for compiled app
  12. FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine3.8 as baseimage
  13. RUN apk add --update nodejs nodejs-npm
  14. WORKDIR /app
  15. COPY --from=builder /app .
  16. ENV ASPNETCORE_URLS=http://+:$port
  17. # Run the application. REPLACE the name of dll with the name of the dll produced by your application
  18. EXPOSE $port
  19. CMD ["dotnet", "TEAMModelOS.dll"]