Skip to content

Commit

Permalink
chore: add ps1 support for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
zakhaev26 committed Dec 20, 2024
1 parent ceb6a33 commit 950d884
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions start.ps1
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 950d884

Please sign in to comment.