Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dotnet-cicd-demo
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eoc-group
dotnet-cicd-demo
Commits
5a80d609
Commit
5a80d609
authored
Aug 13, 2025
by
shipengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dockerfile
parent
72549b9e
Pipeline
#775
failed with stage
Changes
4
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
13 deletions
+87
-13
.dockerignore
.dockerignore
+31
-0
Dockerfile
DotNetCicdDemo/Dockerfile
+30
-0
DotNetCicdDemo.csproj
DotNetCicdDemo/DotNetCicdDemo.csproj
+2
-0
launchSettings.json
DotNetCicdDemo/Properties/launchSettings.json
+24
-13
No files found.
.dockerignore
0 → 100644
View file @
5a80d609
**/.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
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
\ No newline at end of file
DotNetCicdDemo/Dockerfile
0 → 100644
View file @
5a80d609
# 请参阅 https://aka.ms/customizecontainer 以了解如何自定义调试容器,以及 Visual Studio 如何使用此 Dockerfile 生成映像以更快地进行调试。
# 此阶段用于在快速模式(默认为调试配置)下从 VS 运行时
FROM
mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base
USER
$APP_UID
WORKDIR
/app
EXPOSE
8080
# 此阶段用于生成服务项目
FROM
mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
ARG
BUILD_CONFIGURATION=Release
WORKDIR
/src
COPY
["DotNetCicdDemo/DotNetCicdDemo.csproj", "DotNetCicdDemo/"]
RUN
dotnet restore
"./DotNetCicdDemo/DotNetCicdDemo.csproj"
COPY
. .
WORKDIR
"/src/DotNetCicdDemo"
RUN
dotnet build
"./DotNetCicdDemo.csproj"
-c
$BUILD_CONFIGURATION
-o
/app/build
# 此阶段用于发布要复制到最终阶段的服务项目
FROM
build AS publish
ARG
BUILD_CONFIGURATION=Release
RUN
dotnet publish
"./DotNetCicdDemo.csproj"
-c
$BUILD_CONFIGURATION
-o
/app/publish /p:UseAppHost
=
false
# 此阶段在生产中使用,或在常规模式下从 VS 运行时使用(在不使用调试配置时为默认值)
FROM
base AS final
WORKDIR
/app
COPY
--from=publish /app/publish .
ENTRYPOINT
["dotnet", "DotNetCicdDemo.dll"]
\ No newline at end of file
DotNetCicdDemo/DotNetCicdDemo.csproj
View file @
5a80d609
...
...
@@ -4,9 +4,11 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>
...
...
DotNetCicdDemo/Properties/launchSettings.json
View file @
5a80d609
{
"$schema"
:
"http://json.schemastore.org/launchsettings.json"
,
"iisSettings"
:
{
"windowsAuthentication"
:
false
,
"anonymousAuthentication"
:
true
,
"iisExpress"
:
{
"applicationUrl"
:
"http://localhost:63286"
,
"sslPort"
:
0
}
},
{
"profiles"
:
{
"http"
:
{
"commandName"
:
"Project"
,
"dotnetRunMessages"
:
true
,
"launchBrowser"
:
true
,
"launchUrl"
:
"swagger"
,
"applicationUrl"
:
"http://localhost:5143"
,
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
},
"dotnetRunMessages"
:
true
,
"applicationUrl"
:
"http://localhost:5143"
},
"IIS Express"
:
{
"commandName"
:
"IISExpress"
,
...
...
@@ -26,6 +17,25 @@
"environmentVariables"
:
{
"ASPNETCORE_ENVIRONMENT"
:
"Development"
}
},
"Container (Dockerfile)"
:
{
"commandName"
:
"Docker"
,
"launchBrowser"
:
true
,
"launchUrl"
:
"{Scheme}://{ServiceHost}:{ServicePort}/swagger"
,
"environmentVariables"
:
{
"ASPNETCORE_HTTP_PORTS"
:
"8080"
},
"publishAllPorts"
:
true
,
"useSSL"
:
false
}
},
"$schema"
:
"http://json.schemastore.org/launchsettings.json"
,
"iisSettings"
:
{
"windowsAuthentication"
:
false
,
"anonymousAuthentication"
:
true
,
"iisExpress"
:
{
"applicationUrl"
:
"http://localhost:63286"
,
"sslPort"
:
0
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment