Skip to content

Commit ad4a72d

Browse files
committed
Add dockerfile
1 parent f72aef7 commit ad4a72d

13 files changed

+192
-3
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+
**/bin
15+
**/charts
16+
**/docker-compose*
17+
**/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

.vscode/launch.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": ".NET Core Launch (web)",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"preLaunchTask": "build",
9+
"program": "${workspaceFolder}/AZ2003App/bin/Debug/net8.0/AZ2003App.dll",
10+
"args": [],
11+
"cwd": "${workspaceFolder}/AZ2003App",
12+
"stopAtEntry": false,
13+
"serverReadyAction": {
14+
"action": "openExternally",
15+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
16+
},
17+
"env": {
18+
"ASPNETCORE_ENVIRONMENT": "Development"
19+
},
20+
"sourceFileMap": {
21+
"/Views": "${workspaceFolder}/Views"
22+
}
23+
},
24+
{
25+
"name": ".NET Core Attach",
26+
"type": "coreclr",
27+
"request": "attach"
28+
},
29+
{
30+
"name": "Docker .NET Launch",
31+
"type": "docker",
32+
"request": "launch",
33+
"preLaunchTask": "docker-run: debug",
34+
"netCore": {
35+
"appProject": "${workspaceFolder}/AZ2003App/AZ2003App.csproj"
36+
}
37+
}
38+
]
39+
}

.vscode/tasks.json

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/AZ2003App.sln",
11+
"/property:GenerateFullPaths=true",
12+
"/consoleloggerparameters:NoSummary;ForceNoAlign"
13+
],
14+
"problemMatcher": "$msCompile"
15+
},
16+
{
17+
"label": "publish",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"publish",
22+
"${workspaceFolder}/AZ2003App.sln",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary;ForceNoAlign"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "watch",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"watch",
34+
"run",
35+
"--project",
36+
"${workspaceFolder}/AZ2003App.sln"
37+
],
38+
"problemMatcher": "$msCompile"
39+
},
40+
{
41+
"type": "docker-build",
42+
"label": "docker-build: debug",
43+
"dependsOn": [
44+
"build"
45+
],
46+
"dockerBuild": {
47+
"tag": "codespaceiaccoding:dev",
48+
"target": "base",
49+
"dockerfile": "${workspaceFolder}/AZ2003App/Dockerfile",
50+
"context": "${workspaceFolder}",
51+
"pull": true
52+
},
53+
"netCore": {
54+
"appProject": "${workspaceFolder}/AZ2003App/AZ2003App.csproj"
55+
}
56+
},
57+
{
58+
"type": "docker-build",
59+
"label": "docker-build: release",
60+
"dependsOn": [
61+
"build"
62+
],
63+
"dockerBuild": {
64+
"tag": "codespaceiaccoding:latest",
65+
"dockerfile": "${workspaceFolder}/AZ2003App/Dockerfile",
66+
"context": "${workspaceFolder}",
67+
"platform": {
68+
"os": "linux",
69+
"architecture": "amd64"
70+
},
71+
"pull": true
72+
},
73+
"netCore": {
74+
"appProject": "${workspaceFolder}/AZ2003App/AZ2003App.csproj"
75+
}
76+
},
77+
{
78+
"type": "docker-run",
79+
"label": "docker-run: debug",
80+
"dependsOn": [
81+
"docker-build: debug"
82+
],
83+
"dockerRun": {},
84+
"netCore": {
85+
"appProject": "${workspaceFolder}/AZ2003App/AZ2003App.csproj",
86+
"enableDebugging": true
87+
}
88+
},
89+
{
90+
"type": "docker-run",
91+
"label": "docker-run: release",
92+
"dependsOn": [
93+
"docker-build: release"
94+
],
95+
"dockerRun": {},
96+
"netCore": {
97+
"appProject": "${workspaceFolder}/AZ2003App/AZ2003App.csproj"
98+
}
99+
}
100+
]
101+
}

AZ2003App/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
2+
WORKDIR /app
3+
EXPOSE 5000
4+
5+
ENV ASPNETCORE_URLS=http://+:5000
6+
7+
USER app
8+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build
9+
ARG configuration=Release
10+
WORKDIR /src
11+
COPY ["AZ2003App/AZ2003App.csproj", "AZ2003App/"]
12+
RUN dotnet restore "AZ2003App/AZ2003App.csproj"
13+
COPY . .
14+
WORKDIR "/src/AZ2003App"
15+
RUN dotnet build "AZ2003App.csproj" -c $configuration -o /app/build
16+
17+
FROM build AS publish
18+
ARG configuration=Release
19+
RUN dotnet publish "AZ2003App.csproj" -c $configuration -o /app/publish /p:UseAppHost=false
20+
21+
FROM base AS final
22+
WORKDIR /app
23+
COPY --from=publish /app/publish .
24+
ENTRYPOINT ["dotnet", "AZ2003App.dll"]
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

AZ2003App/obj/Debug/net8.0/AZ2003App.AssemblyInfo.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[assembly: System.Reflection.AssemblyCompanyAttribute("AZ2003App")]
1414
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
1515
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
16-
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3596d4f798f79165c92f37d84645539ff5704acf")]
16+
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f72aef7193eb8ade9b0c08087ed658bf1e2b2856")]
1717
[assembly: System.Reflection.AssemblyProductAttribute("AZ2003App")]
1818
[assembly: System.Reflection.AssemblyTitleAttribute("AZ2003App")]
1919
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6cb431f62e870eb0362abda273d8ff629bec13922d4596f659cb5df1b8ce74fb
1+
9ad38060060157684aefe47a06df411ac3db0cbdf3826b2aed1915a579d83c5d
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documents":{"/workspaces/Codespace_IaC_Coding/*":"https://raw.githubusercontent.com/lukemurraynz/Codespace_IaC_Coding/3596d4f798f79165c92f37d84645539ff5704acf/*"}}
1+
{"documents":{"/workspaces/Codespace_IaC_Coding/*":"https://raw.githubusercontent.com/lukemurraynz/Codespace_IaC_Coding/f72aef7193eb8ade9b0c08087ed658bf1e2b2856/*"}}
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)