You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
519 B
Docker

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 部署Docker WebApi
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS EnvStudy
ENV Dockerfile_version=0.0.1
EXPOSE 80/TCP
WORKDIR /app
COPY WebApiPublish/ /app/
ENTRYPOINT ["dotnet", "DockerStudyApi.dll"]
# docker build -f Dockerfile.WebApi -t env/dockerfile.webapi:latest -t env/dockerfile.webapi:0.0.1 .
# docker run --restart=always -p 6400:80 -d --name dockerfile.webapi.contain env/dockerfile.webapi
# 查看日志 docker logs contain_id -f //使用 -f 参数 实时输出ctl + c 退出(不影响容器运行)