Browse Source

1

shengtang
747575620@qq.com 1 year ago
parent
commit
c1edc32a06
7 changed files with 106 additions and 7 deletions
  1. +25
    -0
      backend/.dockerignore
  2. +7
    -0
      backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj
  3. +1
    -1
      backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user
  4. +25
    -0
      backend/BPA.MES.Base.Web.Entry/Dockerfile
  5. +11
    -6
      backend/BPA.MES.Base.Web.Entry/Properties/launchSettings.json
  6. +7
    -0
      backend/NuGet.config
  7. +30
    -0
      backend/dockerfile

+ 25
- 0
backend/.dockerignore View File

@@ -0,0 +1,25 @@
**/.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

+ 7
- 0
backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj View File

@@ -6,9 +6,16 @@
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
<UserSecretsId>2cf25418-ba37-42f6-94c4-df8b11a33318</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
</ItemGroup>


<ItemGroup>
<ProjectReference Include="..\BPA.MES.Base.Web.Core\BPA.MES.Base.Web.Core.csproj" />
</ItemGroup>


+ 1
- 1
backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user View File

@@ -4,6 +4,6 @@
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>BPA.MES.Base.Web.Entry</ActiveDebugProfile>
<ActiveDebugProfile>Docker</ActiveDebugProfile>
</PropertyGroup>
</Project>

+ 25
- 0
backend/BPA.MES.Base.Web.Entry/Dockerfile View File

@@ -0,0 +1,25 @@
#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/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj", "BPA.MES.Base.Web.Entry/"]
COPY ["BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj", "BPA.MES.Base.Web.Core/"]
COPY ["BPA.MES.Base.Application/BPA.MES.Base.Application.csproj", "BPA.MES.Base.Application/"]
COPY ["BPA.MES.Base.Core/BPA.MES.Base.Core.csproj", "BPA.MES.Base.Core/"]
RUN dotnet restore "BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj"
COPY . .
WORKDIR "/src/BPA.MES.Base.Web.Entry"
RUN dotnet build "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BPA.MES.Base.Web.Entry.dll"]

+ 11
- 6
backend/BPA.MES.Base.Web.Entry/Properties/launchSettings.json View File

@@ -1,4 +1,4 @@
{
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
@@ -12,20 +12,25 @@
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"BPA.MES.Base.Web.Entry": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "http://192.168.1.243:5002",
"dotnetRunMessages": true
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true,
"useSSL": true
}
}
}

+ 7
- 0
backend/NuGet.config View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json"/>
<add key="bpa" value="http://10.2.1.25:10243/repository/bpa/index.json"/>
</packageSources>
</configuration>

+ 30
- 0
backend/dockerfile View File

@@ -0,0 +1,30 @@
#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/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj", "BPA.MES.Base.Web.Entry/"]
COPY ["BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj", "BPA.MES.Base.Web.Core/"]
COPY ["BPA.MES.Base.Application/BPA.MES.Base.Application.csproj", "BPA.MES.Base.Application/"]
COPY ["BPA.MES.Base.Core/BPA.MES.Base.Core.csproj", "BPA.MES.Base.Core/"]



RUN dotnet restore "BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj" --configfile "NuGet.config"

COPY . .
WORKDIR "/src/BPA.MES.Base.Web.Entry"
RUN dotnet build "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "BPA.MES.Base.Web.Entry.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "BPA.MES.Base.Web.Entry.dll"]

Loading…
Cancel
Save