我试图制作一个简单的 docker-compose 文件来运行 net-core 2.2,看起来它正在工作,但是当我对文件进行更改时,它不会重新编译,因此我看不到任何更改。
Dockerfile
FROM microsoft/dotnet:latest
# Create directory for the app source code
RUN mkdir -p /usr/src/api
WORKDIR /usr/src/api
# Copy the source and restore dependencies
COPY . /usr/src/api
RUN dotnet restore
# Expose the port and start the app
EXPOSE 5000
ENTRYPOINT ["dotnet", "run", "--urls", "http://*:5000;http://*:5001"]
CMD [ "dotnet", "run" ]
码头工人撰写文件:
version: "3"
services:
web:
build:
context: .
dockerfile: docker/dotnet/Dockerfile
networks:
- default
ports:
- "5000:5000"
volumes:
- .:/var/www/html
该项目是默认的dotnet new webapi -o playground --no-https
有什么想法或帮助吗?谢谢