From 950d884b4671d16c63178be756cbf626abe088dd Mon Sep 17 00:00:00 2001 From: Soubhik Kumar Gon Date: Fri, 20 Dec 2024 20:19:08 +0530 Subject: [PATCH] chore: add ps1 support for windows --- start.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 start.ps1 diff --git a/start.ps1 b/start.ps1 new file mode 100644 index 0000000..d6d8ec4 --- /dev/null +++ b/start.ps1 @@ -0,0 +1,18 @@ +# Get the private IP address excluding the loopback interface +$privateIp = (Get-NetIPAddress | Where-Object { $_.AddressFamily -eq 'IPv4' -and $_.IPAddress -ne '127.0.0.1' }).IPAddress + +# Check if a private IP was found +if ($privateIp -eq $null) { + Write-Host "Private IP not found!" + exit 1 +} + +# Print the private IP (you can export it or use it in your docker-compose command) +Write-Host "Private IP: $privateIp" + +# Run docker-compose with the private IP (you can set an environment variable or use it directly) +# Set environment variable (optional) +[System.Environment]::SetEnvironmentVariable("PRIVATE_IP", $privateIp, [System.EnvironmentVariableTarget]::User) + +# You can now use this private IP in your docker-compose.yml file, e.g., by referencing the environment variable +# docker-compose up -d