Skip to content

Commit 1464106

Browse files
committed
added docker support
1 parent 4c2c41e commit 1464106

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.dockerignore

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

AspNetRunBasic/AspNetRunBasic.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<UserSecretsId>cfcaf7bb-815b-4e0e-b5d8-6345624b1f7f</UserSecretsId>
6+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
57
</PropertyGroup>
68

79

@@ -15,6 +17,7 @@
1517
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1618
</PackageReference>
1719
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.0" />
20+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.10" />
1821
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.0" />
1922
</ItemGroup>
2023

AspNetRunBasic/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
4+
WORKDIR /app
5+
EXPOSE 80
6+
EXPOSE 443
7+
8+
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
9+
WORKDIR /src
10+
COPY ["/AspNetRunBasic.csproj", "AspNetRunBasic/"]
11+
RUN dotnet restore "AspNetRunBasic/AspNetRunBasic.csproj"
12+
COPY . .
13+
WORKDIR "/AspNetRunBasic"
14+
RUN dotnet build "AspNetRunBasic.csproj" -c Release -o /app/build
15+
16+
FROM build AS publish
17+
RUN dotnet publish "AspNetRunBasic.csproj" -c Release -o /app/publish
18+
19+
FROM base AS final
20+
WORKDIR /app
21+
COPY --from=publish /app/publish .
22+
ENTRYPOINT ["dotnet", "AspNetRunBasic.dll"]

0 commit comments

Comments
 (0)