Commit e3e5f855 authored by 罗超's avatar 罗超

docker sup

parent 6b3711aa
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
\ No newline at end of file
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /
COPY ["Edu.WebApi/Edu.WebApi.csproj", "Edu.WebApi/"]
COPY ["Edu.Repository/Edu.Repository.csproj", "Edu.Repository/"]
COPY ["Edu.Common/Edu.Common.csproj", "Edu.Common/"]
COPY ["Edu.Model/Edu.Model.csproj", "Edu.Model/"]
COPY ["Edu.Module.User/Edu.Module.User.csproj", "Edu.Module.User/"]
COPY ["Edu.Aop/Edu.Aop.csproj", "Edu.Aop/"]
COPY ["Edu.Cache/Edu.Cache.csproj", "Edu.Cache/"]
COPY ["Edu.Module.Question/Edu.Module.Question.csproj", "Edu.Module.Question/"]
COPY ["Edu.Module.System/Edu.Module.System.csproj", "Edu.Module.System/"]
COPY ["Edu.Module.Course/Edu.Module.Course.csproj", "Edu.Module.Course/"]
RUN dotnet restore "Edu.WebApi/Edu.WebApi.csproj"
COPY . .
WORKDIR "/Edu.WebApi"
RUN dotnet build "Edu.WebApi.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Edu.WebApi.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Edu.WebApi.dll"]
\ No newline at end of file
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel> <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
<UserSecretsId>6523136f-4bbb-488b-acfd-46dc67794d9f</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Remove="Properties\PublishProfiles\**" /> <Compile Remove="Properties\PublishProfiles\**" />
...@@ -15,6 +17,7 @@ ...@@ -15,6 +17,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="JWT" Version="5.3.1" /> <PackageReference Include="JWT" Version="5.3.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -27,7 +27,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.System", "Edu.Mo ...@@ -27,7 +27,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.System", "Edu.Mo
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Course", "Edu.Module.Course\Edu.Module.Course.csproj", "{3B21886D-A9E1-4C74-85B4-7740935AF791}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Course", "Edu.Module.Course\Edu.Module.Course.csproj", "{3B21886D-A9E1-4C74-85B4-7740935AF791}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Edu.Module.Question", "Edu.Module.Question\Edu.Module.Question.csproj", "{F3E4D4C5-FD08-44DE-AB65-850071BE7FEF}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Edu.Module.Question", "Edu.Module.Question\Edu.Module.Question.csproj", "{F3E4D4C5-FD08-44DE-AB65-850071BE7FEF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{297A2A6E-5BAA-4FB9-BD6A-D7792799CF17}"
ProjectSection(SolutionItems) = preProject
.dockerignore = .dockerignore
Edu.WebApi\Dockerfile = Edu.WebApi\Dockerfile
EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment