Skip to content

Commit

Permalink
change startup script
Browse files Browse the repository at this point in the history
  • Loading branch information
david1542 committed Jul 26, 2024
1 parent 301c2eb commit ae40f32
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/deployments/aws-terraform/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ echo "Starting startup script..."

echo "CD to home directory"
cd /home/ubuntu
sudo chown -R $USER:$USER /home/ubuntu

echo "Setting up environment variables..."
export slack_bot_token="${slack_bot_token}"
Expand All @@ -23,6 +24,15 @@ replace_env_value() {
sed -i "s|$variable_name=\"[^\"]*\"|$variable_name=\"$new_value\"|g" "$filename"
}

replace_value() {
local filename=$1
local variable_name=$2
local new_value=$3

# Use sed to replace the value of the variable
sed -i "s|$variable_name|$new_value|g" "$filename"
}

echo "Installing dependencies..."
apt-get update -y
apt-get install -y ca-certificates curl gnupg lsb-release
Expand Down Expand Up @@ -57,6 +67,10 @@ replace_env_value .env DASHBOARD_API_URL http://$public_ip:3000
replace_env_value .env DASHBOARD_ORY_URL http://$public_ip:4433
replace_env_value .env KRATOS_SELF_SERVE_UI_BROWSER_URL http://$public_ip:4433

# Change Ory Kratos configuration
replace_value config/kratos/kratos.yml localhost $public_ip
replace_value config/kratos/kratos.yml host.docker.internal $public_ip

echo "Running docker compose..."
docker compose up -d --build

Expand Down

0 comments on commit ae40f32

Please sign in to comment.