Dockerfile 1.3 KB

12345678910111213141516171819202122232425262728
  1. # 构建前端工程
  2. FROM node as nodebuild
  3. COPY ./WebApp /webapp
  4. WORKDIR /webapp
  5. RUN npm install --registry http://10.210.62.246:8081/repository/npm-group/ && npm run build:modern
  6. # 构建后端工程
  7. FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
  8. COPY ./WebApi/ .
  9. RUN dotnet publish -f netcoreapp3.1 ./src/Nvcc.Web/Nvcc.Web.csproj -c release -o ./publish
  10. #构建运行时
  11. FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
  12. RUN echo "deb http://mirrors.aliyun.com/debian stretch main contrib non-free \
  13. deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free \
  14. deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free \
  15. deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free \
  16. deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free \
  17. deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free \
  18. deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \
  19. deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" > /etc/apt/sources.list
  20. RUN apt-get update
  21. RUN apt-get install libgdiplus -y && ln -s libgdiplus.so gdiplus.dll
  22. WORKDIR /app
  23. EXPOSE 80
  24. # 拷贝源码
  25. COPY --from=build /publish .
  26. COPY --from=nodebuild /publish/wwwroot ./wwwroot
  27. ENTRYPOINT ["dotnet", "Nvcc.Web.dll"]