目前还是使用将发布出来的文件打包进docker镜像的形式
$ docker build -t pims . $ docker run --name pims --rm -d -p 8080:80 pims
运行Vue.js编译出来的前端代码
$ docker run -p 8081:80 --name pimsweb -v D:/Corechina/Penbox/task/项目投资管理/vue发布/projectinvestment:/usr/share/nginx/html --rm -d nginx:stable-alpine
Dockerfile如下
FROM microsoft/dotnet AS build COPY PIMS/*.csproj ./app/PIMS/ WORKDIR /app/PIMS RUN dotnet restore COPY PIMS/. ./ RUN dotnet publish -o out /p:PublishWithAspNetCoreTargetManifest="false" FROM microsoft/dotnet AS runtime ENV ASPNETCORE_URLS http://+:80 WORKDIR /app COPY --from=build /app/PIMS/out ./ COPY PIMS/bin/Release/netcoreapp2.1/PIMS.xml ./ ENTRYPOINT ["dotnet", "PIMS.dll"]
运行Swagger UI
$ docker run -p 8082:80 --name swagger -v D:penboxswaggerswagger-ui-masterdist:/usr/share/nginx/html --rm -d nginx:stable-alpine