From 4c9c7929b05d28e737de6f3bc368184314c06259 Mon Sep 17 00:00:00 2001 From: Benedikt Seeger <benedikt.seeger@ptb.de> Date: Thu, 25 Apr 2024 15:12:14 +0200 Subject: [PATCH] removed no working IP detection --- dockerfile | 8 +++----- startkBokehAndPrintIp.sh | 39 --------------------------------------- 2 files changed, 3 insertions(+), 44 deletions(-) delete mode 100755 startkBokehAndPrintIp.sh diff --git a/dockerfile b/dockerfile index 1fc6c5a..e157f0e 100644 --- a/dockerfile +++ b/dockerfile @@ -3,15 +3,13 @@ FROM python:3.11 # WORKDIR /usr/src/app ENV GIT_SSL_NO_VERIFY=1 # Install net-tools for ifconfig -RUN apt-get update && \ - apt-get install -y net-tools && \ - rm -rf /var/lib/apt/lists/* + # Install any needed packages specified in requirements.txt RUN git clone https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend.git RUN pip install --no-cache-dir -r dsi-parser-frontend/requirements.txt EXPOSE 5020 -CMD ["dsi-parser-frontend/startkBokehAndPrintIp.sh"] -#CMD ["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"] + +CMD ["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"] diff --git a/startkBokehAndPrintIp.sh b/startkBokehAndPrintIp.sh deleted file mode 100755 index f7193d6..0000000 --- a/startkBokehAndPrintIp.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -#!/bin/bash - -# Function to print IP addresses using ip command -function print_ips_with_ip() { - echo "IP addresses on this machine:" - ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' -} - -# Function to print IP addresses using ifconfig command -function print_ips_with_ifconfig() { - echo "IP addresses on this machine:" - ifconfig | grep -o 'inet addr:\S*' | cut -d':' -f2 -} - -# Check if ip command is available and use it, otherwise try ifconfig -if command -v ip >/dev/null 2>&1; then - print_ips_with_ip -elif command -v ifconfig >/dev/null 2>&1; then - print_ips_with_ifconfig -else - echo "No tool available to find IP addresses." -fi - -# Define the initial Bokeh server command -CMD=("bokeh" "serve" "dsi-parser-frontend/" "--port" "5020" "--allow-websocket-origin" "*" "--use-xheaders" "--prefix" "dsi-parser-frontend") - -# Execute the command -"${CMD[@]}" -EXIT_STATUS=$? - -# Check if the command failed -if [ $EXIT_STATUS -ne 0 ]; then - echo "Initial Bokeh server command failed. Attempting fallback command..." - # Define and execute the fallback Bokeh server command - CMD=("bokeh" "serve" "./" "--port" "5020" "--allow-websocket-origin" "*" "--use-xheaders" "--prefix" "dsi-parser-frontend") - "${CMD[@]}" -fi \ No newline at end of file -- GitLab