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

chnaged remotedebugging added ip print

parent b6456aa8
No related branches found
No related tags found
No related merge requests found
......@@ -3,22 +3,24 @@ 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"
#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"
#ENV no_proxy="ptb.de"
#RUN curl --header "PRIVATE-TOKEN: FcuX-ACu_Lp928iy_1nG" "https://gitlab1.ptb.de/api/v4/projects/2806/repository/files/requirements.txt/raw?ref=main" -o requirements.txt
# Install any needed packages specified in requirements.txt
RUN git clone https://dockerPull:Wz2547C6UNSQkkbuqhMY@gitlab1.ptb.de/digitaldynamicmeasurement/pydccdisplayer.git
RUN pip install --proxy=webproxy.bs.ptb.de:8080 --no-cache-dir -r pydccdisplayer/requirements.txt
#RUN pip install --proxy=webproxy.bs.ptb.de:8080 --no-cache-dir -r pydccdisplayer/requirements.txt
RUN pip install --no-cache-dir -r pydccdisplayer/requirements.txt
#RUN pip install --no-cache-dir -r pydccdisplayer/requirements.txt
#COPY . .
# Set the environment variable for enabling remote debugging
ENV ENABLE_REMOTE_DEBUG=1
EXPOSE 5003 12345
EXPOSE 5003 6003
#WORKDIR ./pydccdisplayer/src
CMD ["bokeh", "serve", "pydccdisplayer/src/.", "--port", "5003", "--allow-websocket-origin", "*","--use-xheaders","--prefix","pydccdisplayer"]
import base64
import io
import json
import os
import sys
import socket
import tarfile
import warnings
import bokehCssPTB
......@@ -19,10 +22,34 @@ from dcc_XMLJSONConv.dcc_Conv import dcc as converterDcc
VERSION = "0.1.0"
import pydevd_pycharm
# The host and port should match the configuration in PyCharm's debug server settings
pydevd_pycharm.settrace('host.docker.internal', port=12345, stdoutToServer=True, stderrToServer=True)
# Function to get the system's IP address
def get_ip_address():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
# This doesn't actually make a request
s.connect(("8.8.8.8", 80))
IP = s.getsockname()[0]
except Exception:
IP = "127.0.0.1"
finally:
s.close()
return IP
# Check if the specific environment variable is set
if os.getenv('ENABLE_REMOTE_DEBUG') == '1':
try:
import pydevd_pycharm
# Set the debugger to connect back to PyCharm using the specified port
pydevd_pycharm.settrace('host.docker.internal', port=6003, stdoutToServer=True, stderrToServer=True)
print(f"Remote debugging is enabled. Connecting to debug server at host.docker.internal:6003")
except ImportError:
print("pydevd_pycharm is not installed. Please install it for remote debugging.")
sys.exit(1)
except Exception as e:
print(f"Failed to start remote debugging: {e}")
sys.exit(1)
print("Starting DCCVwier server at ", get_ip_address())
class page:
def __init__(self):
self.fileUploader = fileUploader(self.readFile)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment