NgixProxy_Pathfinder/deploy.sh

23 lines
436 B
Bash

#!/bin/bash
set -e
echo "Detecting Public IP..."
CURRENT_IP=$(curl -s https://ifconfig.me)
if [ -z "$CURRENT_IP" ]; then
echo "Error: Could not detect Public IP."
exit 1
fi
echo "Public IP detected: $CURRENT_IP"
echo "HOST_PUBLIC_IP=$CURRENT_IP" > .env
echo "Building and testing..."
docker compose build
docker compose run --rm nginx-proxy nginx -t
echo "Deploying..."
docker compose up -d
echo "Done! Proxy is running."