-
Notifications
You must be signed in to change notification settings - Fork 5
/
edit-docker-compose.sh
executable file
·15 lines (8 loc) · 1.08 KB
/
edit-docker-compose.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash
# Dumb script to edit a template file and replace the ksqldb-server line
PUBLIC_HOSTNAME=$(curl http://169.254.169.254/latest/meta-data/public-hostname)
DOCKER_COMPOSE_FILE="/home/ubuntu/cp-zeek/docker-compose.yml"
# Run this if you want to (have to) run Confluent Control Center on port 80 and ksqldb server (REST API) on port 443 with no encryption
#/bin/sed -e 's/ CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: \"http:\/\/localhost:8088\"/ CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: \"http:\/\/'$PUBLIC_HOSTNAME':443\"/' -e 's/ - "9021:9021"/ - "80:9021"/' -e 's/ - "8088:8088"/ - "443:8088"/' $DOCKER_COMPOSE_FILE > /home/ubuntu/cp-zeek/workshop-docker-compose.yml
# Run this if you are sane and can run these services on their default ports (9021 for Confluent Control Center and 8088 for ksqlDB)
/bin/sed -e 's/ CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: \"http:\/\/localhost:8088\"/ CONTROL_CENTER_KSQL_KSQLDB1_ADVERTISED_URL: \"http:\/\/'$PUBLIC_HOSTNAME':8088\"/' $DOCKER_COMPOSE_FILE > /home/ubuntu/cp-zeek/workshop-docker-compose.yml