mimaison commented on code in PR #410:
URL: https://github.com/apache/kafka-site/pull/410#discussion_r872225024


##########
start-preview.sh:
##########
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+set -euxo pipefail
+
+docker build -t kafka-site-preview .
+
+docker run -dit --rm --name mypreview -p 8080:80 -v 
"$PWD":/usr/local/apache2/htdocs/ kafka-site-preview
+
+echo "You can stop the preview server by running `docker stop mypreview`"

Review Comment:
   What about doing something like this to make it even easier to use?
   
   ```suggestion
   #!/usr/bin/env bash
   
   set -euo pipefail
   
   clean() {
     docker stop site-preview
     exit 0
   }
   
   trap clean SIGINT
   
   docker build -t kafka-site-preview .
   
   docker run -dit --rm --name site-preview -p 8080:80 -v 
"$PWD":/usr/local/apache2/htdocs/ kafka-site-preview
   
   echo "The preview is available on http://localhost:8080.";
   echo "Press CTRL+C to stop it."
   
   read -r -d '' _ </dev/tty
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to