Skip to content
Snippets Groups Projects
Commit 4c9c7929 authored by Benedikt's avatar Benedikt
Browse files

removed no working IP detection

parent 752538b0
No related branches found
No related tags found
No related merge requests found
......@@ -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"]
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment