12345678910111213141516171819202122232425262728 |
- # 构建前端工程
- FROM node as nodebuild
- COPY ./WebApp /webapp
- WORKDIR /webapp
- RUN npm install --registry http://10.210.62.246:8081/repository/npm-group/ && npm run build:modern
- # 构建后端工程
- FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
- COPY ./WebApi/ .
- RUN dotnet publish -f netcoreapp3.1 ./src/Nvcc.Web/Nvcc.Web.csproj -c release -o ./publish
- #构建运行时
- FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
- RUN echo "deb http://mirrors.aliyun.com/debian stretch main contrib non-free \
- deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free \
- deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free \
- deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free \
- deb http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free \
- deb-src http://mirrors.aliyun.com/debian-security stretch/updates main contrib non-free \
- deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \
- deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" > /etc/apt/sources.list
- RUN apt-get update
- RUN apt-get install libgdiplus -y && ln -s libgdiplus.so gdiplus.dll
- WORKDIR /app
- EXPOSE 80
- # 拷贝源码
- COPY --from=build /publish .
- COPY --from=nodebuild /publish/wwwroot ./wwwroot
- ENTRYPOINT ["dotnet", "Nvcc.Web.dll"]
|