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

changed start method of docker file

parent 17cbe2d5
No related branches found
No related tags found
No related merge requests found
......@@ -2,22 +2,13 @@ FROM python:3.11
# WORKDIR /usr/src/app
ENV GIT_SSL_NO_VERIFY=1
# Set the environment variable for the HTTP proxy
#ENV http_proxy="http://webproxy.bs.ptb.de:8080"
#ENV https_proxy="http://webproxy.bs.ptb.de:8080"
# Set the environment variable for the NO_PROXY
# This ensures that the proxy is not used for ptb.de
#ENV no_proxy="ptb.de"
# Install any needed packages specified in requirements.txt
RUN git clone https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend.git
#RUN pip install --proxy=webproxy.bs.ptb.de:8080 --no-cache-dir -r dsi-parser-frontend/requirements.txt
RUN pip install --no-cache-dir -r dsi-parser-frontend/requirements.txt
EXPOSE 5020
CMD ["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"]
CMD ["./startkBokehAndPrintIp.sh"]
#CMD ["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"]
import base64
import io
import json
import tarfile
# This file is part of dsiUnitsFrontend (https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend)
# Copyright 2024 [Benedikt Seeger(PTB), Vanessa Stehr(PTB)]
#This library is free software; you can redistribute it and/or
#modify it under the terms of the GNU Lesser General Public
#License as published by the Free Software Foundation; either
#version 2.1 of the License, or (at your option) any later version.
#This library is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#Lesser General Public License for more details.
#You should have received a copy of the GNU Lesser General Public
#License along with this library; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import warnings
import itertools
import math
......@@ -16,6 +28,19 @@ from bokeh.events import ValueSubmit
import numpy as np
colors=Category10[10]
VERSION = "0.1.0"
import socket
def get_local_ip():
try:
# Creates a socket connection to Google's public DNS server to determine the internal network IP
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s:
s.connect(("8.8.8.8", 80)) # Using Google DNS, and connecting via dummy request
local_ip = s.getsockname()[0] # Returns the IP where the socket is connected
return local_ip
except Exception as e:
return f"Unable to get IP: {e}"
issueTemplate="""There was an issue with the following unit conversion:
......@@ -284,9 +309,7 @@ class page():
issueUrl = r'https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend/-/issues/new?'
title = quote(filledTitle)
body = quote(filledResult)
url = issueUrl + 'issue[title]=' + title + '&issue[description]=' + body
return url
def clearComparison(self):
......@@ -300,4 +323,5 @@ class page():
if self.dsiInput1.valideUnit and self.dsiInput2.valideUnit:
self.compare()
thisPage = page()
#!/bin/bash
# Find the local IP address. This line gets the IP address associated with the default route.
LOCAL_IP=$(ip route get 1 | awk '{print $7;exit}')
# Print the local IP address
echo "Local IP Address: $LOCAL_IP"
# Run the Bokeh server command
CMD=("bokeh" "serve" "./" "--port" "5020" "--allow-websocket-origin" "*" "--use-xheaders" "--prefix" "dsi-parser-frontend")
# Execute the command
"${CMD[@]}"
\ 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