Docker configuration for Identity Api host.

pull/81/head
Halil İbrahim Kalkan 9 years ago
parent 363c3cbad5
commit abf83ba505

@ -1,35 +1,50 @@
# COMMON PATHS
$buildFolder = (Get-Item -Path ".\" -Verbose).FullName
$slnFolder = Join-Path $buildFolder "..\"
$buildFolder = (Get-Item -Path "./" -Verbose).FullName
$slnFolder = Join-Path $buildFolder "../"
$outputFolder = Join-Path $buildFolder "outputs"
$abpDeskFolder = Join-Path $slnFolder "src/AbpDesk"
$abpDeskWebFolder = Join-Path $abpDeskFolder "AbpDesk.Web.Mvc"
# CLEAR
## CLEAR ######################################################################
Remove-Item $outputFolder -Force -Recurse
New-Item -Path $outputFolder -ItemType Directory
# BUILD
## RESTORE NUGET PACKAGES #####################################################
Set-Location $slnFolder
dotnet restore
# PUBLISH
## PUBLISH ASPDESK WEB ########################################################
Set-Location $abpDeskWebFolder
dotnet publish --output (Join-Path $outputFolder "AbpDesk/Web")
# CREATE DOCKER IMAGES
New-Item -Path (Join-Path $outputFolder "AbpDesk/Web/PlugIns") -ItemType Directory
Copy-Item (Join-Path $abpDeskFolder "Web_PlugIns/*") (Join-Path $outputFolder "AbpDesk/Web/PlugIns/")
## PUBLISH IDENTITY HTTP API HOST #############################################
Set-Location (Join-Path $slnFolder "src/Volo.Abp.Identity.HttpApi.Host")
dotnet publish --output (Join-Path $outputFolder "AbpIdentity/HttpApiHost")
## CREATE DOCKER IMAGES #######################################################
Set-Location (Join-Path $outputFolder "AbpDesk/Web")
docker rmi abpdesk/web -f
docker build -t abpdesk/web .
Copy-Item (Join-Path $slnFolder "/docker/*.*") $outputFolder
Set-Location (Join-Path $outputFolder "AbpIdentity/HttpApiHost")
docker rmi abpidentity/httpapihost -f
docker build -t abpidentity/httpapihost .
## DOCKER COMPOSE FILES #######################################################
Copy-Item (Join-Path $slnFolder "docker/*.*") $outputFolder
# FINALIZE
## FINALIZE ###################################################################
Set-Location $outputFolder

@ -1,6 +1,12 @@
version: '2'
services:
abpidentity_httpapihost:
image: abpidentity/httpapihost
environment:
- ASPNETCORE_ENVIRONMENT=Staging
ports:
- 9101:80
abpdesk_web:
image: abpdesk/web
environment:

@ -1,4 +1,5 @@
docker rm $(docker ps -aq)
docker-compose up -d abpidentity_httpapihost
docker-compose up -d abpdesk_web
sleep 2
docker-compose scale abpdesk_web=2

@ -18,5 +18,9 @@
"Areas/**/*.*"
]
}
},
"scripts": {
"postcompile": [ "xcopy %compile:OutputDir%\\AbpDesk.MongoBlog.dll ..\\Web_PlugIns" ]
}
}

@ -1,7 +1,9 @@
FROM microsoft/aspnetcore
WORKDIR /app
COPY . .
RUN mkdir /Web_PlugIns
RUN mv /app/PlugIns/*.* /Web_PlugIns
ENTRYPOINT ["dotnet", "AbpDesk.Web.Mvc.dll"]

@ -27,7 +27,7 @@ namespace AbpDesk.Web.Mvc
options.PlugInSources.AddFolder(
Path.Combine(
_env.ContentRootPath,
@"..\Web_PlugIns\")
@"../Web_PlugIns/")
);
});
}

@ -1,5 +1,11 @@
{
"ConnectionStrings": {
"Default": "Server=192.168.1.36;Database=AbpDesk;User=sa;Password=123qwe;"
"Default": "Server=192.168.1.36;Database=AbpDesk;User=sa;Password=123qwe;",
"AbpDeskMongoBlog": "mongodb://192.168.1.36:27017|AbpDeskBlog"
},
"AbpIdentity": {
"HttpProxy": {
"ApiUrlBase": "http://192.168.1.36:9101/"
}
}
}

@ -0,0 +1,6 @@
FROM microsoft/aspnetcore
WORKDIR /app
COPY . .
ENTRYPOINT ["dotnet", "Volo.Abp.Identity.HttpApi.Host.dll"]

@ -50,7 +50,9 @@
"include": [
"wwwroot",
"web.config",
"appsettings.json"
"appsettings.json",
"appsettings.Staging.json",
"Dockerfile"
]
},

Loading…
Cancel
Save