mirror of https://github.com/abpframework/abp.git
8 changed files with 85 additions and 8 deletions
@ -1,14 +1,30 @@ |
|||||
$buildFolder = (Get-Item -Path ".\" -Verbose).FullName |
# COMMON PATHS |
||||
$outputFolder = Join-Path $buildFolder "outputs" |
|
||||
|
|
||||
|
$buildFolder = (Get-Item -Path ".\" -Verbose).FullName |
||||
$slnFolder = Join-Path $buildFolder "..\" |
$slnFolder = Join-Path $buildFolder "..\" |
||||
|
$outputFolder = Join-Path $buildFolder "outputs" |
||||
$abpDeskFolder = Join-Path $slnFolder "src/AbpDesk" |
$abpDeskFolder = Join-Path $slnFolder "src/AbpDesk" |
||||
$abpDeskWebFolder = Join-Path $abpDeskFolder "AbpDesk.Web.Mvc" |
$abpDeskWebFolder = Join-Path $abpDeskFolder "AbpDesk.Web.Mvc" |
||||
|
|
||||
|
# BUILD |
||||
|
|
||||
Set-Location $slnFolder |
Set-Location $slnFolder |
||||
dotnet restore |
dotnet restore |
||||
|
|
||||
|
# PUBLISH |
||||
|
|
||||
Set-Location $abpDeskWebFolder |
Set-Location $abpDeskWebFolder |
||||
dotnet publish --output (Join-Path $outputFolder "AbpDesk/Web") |
dotnet publish --output (Join-Path $outputFolder "AbpDesk/Web") |
||||
|
|
||||
Set-Location $buildFolder |
# 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 |
||||
|
|
||||
|
# FINALIZE |
||||
|
|
||||
|
Set-Location $outputFolder |
||||
@ -0,0 +1,21 @@ |
|||||
|
version: '2' |
||||
|
|
||||
|
services: |
||||
|
abpdesk_web_1: |
||||
|
image: abpdesk/web |
||||
|
environment: |
||||
|
- ASPNETCORE_ENVIRONMENT=Staging |
||||
|
ports: |
||||
|
- "9001:80" |
||||
|
abpdesk_web_2: |
||||
|
image: abpdesk/web |
||||
|
environment: |
||||
|
- ASPNETCORE_ENVIRONMENT=Staging |
||||
|
ports: |
||||
|
- "9002:80" |
||||
|
load_balancer: |
||||
|
image: haproxy:1.7.1 |
||||
|
volumes: |
||||
|
- "./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg" |
||||
|
ports: |
||||
|
- "9005:9005" |
||||
@ -0,0 +1,18 @@ |
|||||
|
global |
||||
|
maxconn 4096 |
||||
|
|
||||
|
defaults |
||||
|
mode http |
||||
|
timeout connect 5s |
||||
|
timeout client 50s |
||||
|
timeout server 50s |
||||
|
|
||||
|
listen http-in |
||||
|
bind *:9005 |
||||
|
|
||||
|
server web-1 outputs_abpdesk_web_1_1:80 |
||||
|
server web-2 outputs_abpdesk_web_2_1:80 |
||||
|
|
||||
|
stats enable |
||||
|
stats uri /haproxy |
||||
|
stats refresh 1s |
||||
@ -0,0 +1,7 @@ |
|||||
|
FROM microsoft/aspnetcore |
||||
|
|
||||
|
WORKDIR /app |
||||
|
|
||||
|
COPY . . |
||||
|
|
||||
|
ENTRYPOINT ["dotnet", "AbpDesk.Web.Mvc.dll"] |
||||
@ -0,0 +1,5 @@ |
|||||
|
{ |
||||
|
"ConnectionStrings": { |
||||
|
"Default": "Server=192.168.1.36;Database=AbpDesk;User=sa;Password=123qwe;" |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue