Skip to content

Commit 6ea5a2a

Browse files
Added docker files
1 parent 8763e0b commit 6ea5a2a

20 files changed

+191
-10
lines changed

angular/AbpCompanyName.AbpProjectName.AngularUI.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@
2525
<Reference Include="Microsoft.CSharp" />
2626
</ItemGroup>
2727

28+
<ItemGroup>
29+
<None Update="Dockerfile">
30+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
31+
</None>
32+
</ItemGroup>
33+
2834
</Project>

angular/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM nginx
2+
3+
COPY . /usr/share/nginx/html

angular/obj/AbpCompanyName.AbpProjectName.AngularUI.csproj.nuget.g.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
44
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
55
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
6-
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\Repositories\Github\module-zero-core-template\angular\obj\project.assets.json</ProjectAssetsFile>
6+
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\GitHub\module-zero-core-template\angular\obj\project.assets.json</ProjectAssetsFile>
77
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
8-
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\ismcagdas\.nuget\packages\</NuGetPackageFolders>
8+
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\aliriza\.nuget\packages\</NuGetPackageFolders>
99
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
10-
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.1.0</NuGetToolVersion>
10+
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.2.0</NuGetToolVersion>
1111
</PropertyGroup>
1212
<PropertyGroup>
1313
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>

angular/obj/project.assets.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
".NETFramework,Version=v4.5.2": []
99
},
1010
"packageFolders": {
11-
"C:\\Users\\ismcagdas\\.nuget\\packages\\": {}
11+
"C:\\Users\\aliriza\\.nuget\\packages\\": {}
1212
},
1313
"project": {
1414
"version": "1.0.0",
1515
"restore": {
16-
"projectUniqueName": "D:\\Repositories\\Github\\module-zero-core-template\\angular\\AbpCompanyName.AbpProjectName.AngularUI.csproj",
16+
"projectUniqueName": "D:\\GitHub\\module-zero-core-template\\angular\\AbpCompanyName.AbpProjectName.AngularUI.csproj",
1717
"projectName": "AbpCompanyName.AbpProjectName.AngularUI",
18-
"projectPath": "D:\\Repositories\\Github\\module-zero-core-template\\angular\\AbpCompanyName.AbpProjectName.AngularUI.csproj",
19-
"outputPath": "D:\\Repositories\\Github\\module-zero-core-template\\angular\\obj\\",
18+
"projectPath": "D:\\GitHub\\module-zero-core-template\\angular\\AbpCompanyName.AbpProjectName.AngularUI.csproj",
19+
"outputPath": "D:\\GitHub\\module-zero-core-template\\angular\\obj\\",
2020
"projectStyle": "PackageReference",
2121
"originalTargetFrameworks": [
2222
"net452"

aspnet-core/build/build-mvc.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# COMMON PATHS
2+
3+
$buildFolder = (Get-Item -Path "./" -Verbose).FullName
4+
$slnFolder = Join-Path $buildFolder "../"
5+
$outputFolder = Join-Path $buildFolder "outputs"
6+
$webMvcFolder = Join-Path $slnFolder "src/AbpCompanyName.AbpProjectName.Web.Mvc"
7+
8+
## CLEAR ######################################################################
9+
10+
Remove-Item $outputFolder -Force -Recurse
11+
New-Item -Path $outputFolder -ItemType Directory
12+
13+
## RESTORE NUGET PACKAGES #####################################################
14+
15+
Set-Location $slnFolder
16+
dotnet restore
17+
18+
## PUBLISH WEB MVC PROJECT ###################################################
19+
20+
Set-Location $webMvcFolder
21+
dotnet publish --output (Join-Path $outputFolder "Mvc")
22+
23+
## CREATE DOCKER IMAGES #######################################################
24+
25+
# Mvc
26+
Set-Location (Join-Path $outputFolder "Mvc")
27+
28+
docker rmi zero/mvc -f
29+
docker build -t zero/mvc .
30+
31+
## DOCKER COMPOSE FILES #######################################################
32+
33+
Copy-Item (Join-Path $slnFolder "docker/mvc/*.*") $outputFolder
34+
35+
## FINALIZE ###################################################################
36+
37+
Set-Location $outputFolder

aspnet-core/build/build-with-ng.ps1

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# COMMON PATHS
2+
3+
$buildFolder = (Get-Item -Path "./" -Verbose).FullName
4+
$slnFolder = Join-Path $buildFolder "../"
5+
$outputFolder = Join-Path $buildFolder "outputs"
6+
$webHostFolder = Join-Path $slnFolder "src/AbpCompanyName.AbpProjectName.Web.Host"
7+
$ngFolder = Join-Path $buildFolder "../../angular"
8+
9+
## CLEAR ######################################################################
10+
11+
Remove-Item $outputFolder -Force -Recurse
12+
New-Item -Path $outputFolder -ItemType Directory
13+
14+
## RESTORE NUGET PACKAGES #####################################################
15+
16+
Set-Location $slnFolder
17+
dotnet restore
18+
19+
## PUBLISH WEB HOST PROJECT ###################################################
20+
21+
Set-Location $webHostFolder
22+
dotnet publish --output (Join-Path $outputFolder "Host")
23+
24+
## PUBLISH ANGULAR UI PROJECT #################################################
25+
26+
Set-Location $ngFolder
27+
& ng build -prod
28+
Copy-Item (Join-Path $ngFolder "dist") (Join-Path $outputFolder "ng") -Recurse
29+
Copy-Item (Join-Path $ngFolder "Dockerfile") (Join-Path $outputFolder "ng")
30+
31+
# Change UI configuration
32+
$ngConfigPath = Join-Path $outputFolder "ng/assets/appconfig.json"
33+
(Get-Content $ngConfigPath) -replace "21021", "9901" | Set-Content $ngConfigPath
34+
(Get-Content $ngConfigPath) -replace "4200", "9902" | Set-Content $ngConfigPath
35+
36+
## CREATE DOCKER IMAGES #######################################################
37+
38+
# Host
39+
Set-Location (Join-Path $outputFolder "Host")
40+
41+
docker rmi zero/host -f
42+
docker build -t zero/host .
43+
44+
# Angular UI
45+
Set-Location (Join-Path $outputFolder "ng")
46+
47+
docker rmi zero/ng -f
48+
docker build -t zero/ng .
49+
50+
## DOCKER COMPOSE FILES #######################################################
51+
52+
Copy-Item (Join-Path $slnFolder "docker/ng/*.*") $outputFolder
53+
54+
## FINALIZE ###################################################################
55+
56+
Set-Location $outputFolder
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '2'
2+
3+
services:
4+
5+
zero_mvc:
6+
image: zero/mvc
7+
environment:
8+
- ASPNETCORE_ENVIRONMENT=Staging
9+
ports:
10+
- "9903:80"
11+
volumes:
12+
- "./Mvc-Logs:/app/App_Data/Logs"

aspnet-core/docker/mvc/down.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker-compose down -v --rmi local

aspnet-core/docker/mvc/up.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker-compose up -d
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '2'
2+
3+
services:
4+
5+
zero_host:
6+
image: zero/host
7+
environment:
8+
- ASPNETCORE_ENVIRONMENT=Staging
9+
ports:
10+
- "9901:80"
11+
volumes:
12+
- "./Host-Logs:/app/App_Data/Logs"
13+
14+
zero_ng:
15+
image: zero/ng
16+
ports:
17+
- "9902:80"

0 commit comments

Comments
 (0)