使用Docker调试Asp.Net Core
[[使用 Docker 进行部署|https://windsting.github.io/little-aspnetcore-book/book/chapters/deploy-the-application/deploy-with-docker.html]]
;目前还是使用将发布出来的文件打包进docker镜像的形式
```bash
$ docker build -t pims .
$ docker run --name pims --rm -d -p 8080:80 pims
```
;运行Vue.js编译出来的前端代码
```bash
$ docker run -p 8081:80 --name pimsweb -v D:/Corechina/Penbox/task/项目投资管理/vue发布/projectinvestment:/usr/share/nginx/html --rm -d nginx:stable-alpine
```
Dockerfile如下
```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
```bash
$ docker run -p 8082:80 --name swagger -v D:\penbox\swagger\swagger-ui-master\dist:/usr/share/nginx/html --rm -d nginx:stable-alpine
```