build: docker: dev: added dnsmasq for local domain routing
This commit is contained in:
parent
2e17d714ca
commit
bc57cd84d0
@ -13,7 +13,7 @@ $LocalIp = (Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Where
|
||||
$Doceditor = ($LocalIp + ":5013")
|
||||
$Login = ($LocalIp + ":5011")
|
||||
$Client = ($LocalIp + ":5001")
|
||||
$PortalUrl = ("http://" + $LocalIp + ":8092")
|
||||
$PortalUrl = ("http://" + $LocalIp)
|
||||
$ProxyVersion="v1.0.0"
|
||||
|
||||
# Stop all backend services"
|
||||
@ -38,6 +38,10 @@ if (-not $ExistsNetwork) {
|
||||
Write-Host "Run MySQL" -ForegroundColor Green
|
||||
docker compose -f "$DockerDir\db.yml" up -d
|
||||
|
||||
Write-Host "Run local dns server" -ForegroundColor Green
|
||||
$Env:ROOT_DIR=$dir
|
||||
docker compose -f "$DockerDir\dnsmasq.yml" up -d
|
||||
|
||||
Write-Host "Build backend services (to `publish/` folder)" -ForegroundColor Green
|
||||
& "$PSScriptRoot\install\common\build-services.ps1"
|
||||
|
||||
|
@ -16,7 +16,7 @@ echo "LOCAL IP: $local_ip"
|
||||
doceditor=${local_ip}:5013
|
||||
login=${local_ip}:5011
|
||||
client=${local_ip}:5001
|
||||
portal_url="http://$local_ip:8092"
|
||||
portal_url="http://$local_ip"
|
||||
|
||||
echo "SERVICE_DOCEDITOR: $doceditor"
|
||||
echo "SERVICE_LOGIN: $login"
|
||||
@ -56,6 +56,10 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Run local dns server"
|
||||
ROOT_DIR=$dir \
|
||||
docker compose -f $dockerDir/dnsmasq.yml up -d
|
||||
|
||||
echo "Clear publish folder"
|
||||
rm -rf $dir/publish
|
||||
|
||||
|
19
build/install/docker/dnsmasq.yml
Normal file
19
build/install/docker/dnsmasq.yml
Normal file
@ -0,0 +1,19 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
onlyoffice-dns:
|
||||
image: jpillora/dnsmasq
|
||||
container_name: onlyoffice-dns
|
||||
restart: always
|
||||
expose:
|
||||
- "5380"
|
||||
- "53"
|
||||
ports:
|
||||
- 53:53/udp
|
||||
- 5380:8080
|
||||
environment:
|
||||
- HTTP_USER=foo
|
||||
- HTTP_PASS=bar
|
||||
volumes:
|
||||
- ${ROOT_DIR}/config/dnsmasq.conf:/etc/dnsmasq.conf
|
||||
cap_add:
|
||||
- NET_ADMIN
|
@ -252,7 +252,7 @@ services:
|
||||
- "8099"
|
||||
- "8092"
|
||||
ports:
|
||||
- 8092:8092
|
||||
- 80:8092
|
||||
environment:
|
||||
- SERVICE_BACKUP=${SERVICE_BACKUP}
|
||||
- SERVICE_FILES=${SERVICE_FILES}
|
||||
|
14
config/dnsmasq.conf
Normal file
14
config/dnsmasq.conf
Normal file
@ -0,0 +1,14 @@
|
||||
#dnsmasq config, for a complete example, see:
|
||||
# http://oss.segetech.com/intra/srv/dnsmasq.conf
|
||||
#log all dns queries
|
||||
log-queries
|
||||
#dont use hosts nameservers
|
||||
no-resolv
|
||||
#use cloudflare as default nameservers, prefer 1^4
|
||||
server=8.8.4.4
|
||||
server=8.8.8.8
|
||||
strict-order
|
||||
#serve all .company queries using a specific nameserver
|
||||
server=/site/127.0.0.1
|
||||
#explicitly define host-ip mappings
|
||||
address=/docspace.site/127.0.0.1
|
Loading…
Reference in New Issue
Block a user