Commit 347882ac authored by yaoke.yk's avatar yaoke.yk

运营docker映射端口改动

parent 7a80307a
...@@ -80,6 +80,18 @@ services: ...@@ -80,6 +80,18 @@ services:
- "${FRONTEND_PORT:-3000}:80" - "${FRONTEND_PORT:-3000}:80"
restart: unless-stopped restart: unless-stopped
admin-web:
build:
context: ./yaoai-admin-web
dockerfile: Dockerfile
environment:
ADMIN_API_UPSTREAM: http://backend:8080
depends_on:
- backend
ports:
- "${ADMIN_FRONTEND_PORT:-3001}:80"
restart: unless-stopped
volumes: volumes:
mysql-data: mysql-data:
redis-data: redis-data:
...@@ -11,17 +11,39 @@ try { ...@@ -11,17 +11,39 @@ try {
Write-Host "[prod-local] .env not found, copied from .env.example" Write-Host "[prod-local] .env not found, copied from .env.example"
} }
$config = @{}
Get-Content $envFile | ForEach-Object {
$line = $_.Trim()
if ($line -and -not $line.StartsWith("#") -and $line.Contains("=")) {
$index = $line.IndexOf("=")
$key = $line.Substring(0, $index).Trim()
$value = $line.Substring($index + 1).Trim()
$config[$key] = $value
}
}
function Get-ConfigValue($key, $fallback) {
if ($config.ContainsKey($key) -and $config[$key]) {
return $config[$key]
}
return $fallback
}
$mysqlPort = Get-ConfigValue "MYSQL_PORT" "13306"
$redisPort = Get-ConfigValue "REDIS_PORT" "16379"
$frontendPort = Get-ConfigValue "FRONTEND_PORT" "3000"
$adminFrontendPort = Get-ConfigValue "ADMIN_FRONTEND_PORT" "3001"
$backendPort = Get-ConfigValue "BACKEND_PORT" "8080"
Write-Host "[prod-local] starting root docker-compose.yml ..." Write-Host "[prod-local] starting root docker-compose.yml ..."
docker compose up -d --build docker compose up -d --build
Write-Host "" Write-Host ""
Write-Host "[prod-local] stable local deployment environment" Write-Host "[prod-local] stable local deployment environment"
Write-Host " mysql : localhost:23306" Write-Host " mysql : localhost:$mysqlPort"
Write-Host " redis : localhost:26379" Write-Host " redis : localhost:$redisPort"
Write-Host " frontend : http://localhost:3000" Write-Host " frontend : http://localhost:$frontendPort"
Write-Host " admin-web : http://localhost:3001" Write-Host " admin-web : http://localhost:$adminFrontendPort"
Write-Host " backend : http://localhost:28081" Write-Host " backend : http://localhost:$backendPort"
Write-Host " swagger : http://localhost:28081/swagger-ui/index.html" Write-Host " swagger : http://localhost:$backendPort/swagger-ui/index.html"
Write-Host "" Write-Host ""
Write-Host "[prod-local] if you need different ports, edit .env before running this script." Write-Host "[prod-local] if you need different ports, edit .env before running this script."
Write-Host "[prod-local] do not run 'docker compose down -v' unless you really want to delete prod-local data." Write-Host "[prod-local] do not run 'docker compose down -v' unless you really want to delete prod-local data."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment