【新增】增加docker构建文件dockerfile

This commit is contained in:
jianweie code
2023-02-27 01:19:31 +08:00
parent 75f62f8fba
commit bb103752e2
9 changed files with 107 additions and 30 deletions

View File

@@ -1,13 +1,18 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
RUN apt-get update && apt-get install -y libgdiplus
# 添加基础镜像
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
#容器中系统的工作空间
WORKDIR /app
#设置Docker容器对外暴露的端口
EXPOSE 80
COPY ./ /app
ENV TZ=Asia/Shanghai
#拷贝当前文件夹下的文件到容器中系统的工作空间
COPY . /app
#容器中使用 ["dotnet","系统启动的dll"] 来运行应用程序
#使用ENTRYPOINT ["dotnet","系统启动的dll"]
#或使用 CMD ["dotnet","系统启动的dll"]
ENTRYPOINT ["dotnet", "CoreCms.Net.Web.Admin.dll"]