Commit da0dc0bb authored by Gezer's avatar Gezer
Browse files

Refactor backend and stream processing structure

- Updated Dockerfile in backend to set PYTHONPATH and modify CMD for Django server.
- Changed permissions for multiple Python files in backend to make them executable.
- Adjusted import paths in influxdb_service.py and views.py to reflect new structure.
- Removed unused utils and loggingFactory files from stream_processing.
- Added new utils for logging and flux query building.
- Enhanced error handling and logging in mQTTClientHandler.py.
- Updated docker-compose.yaml to include utils directory for both backend and stream processing services.
- Improved JSON handling in jsonhandler.py with better exception management.
parent 7ba8a99b
File mode changed from 100644 to 100755
# Verwende das neueste Python-Image
FROM python:latest FROM python:latest
# Setze das Arbeitsverzeichnis im Container # Setze das Arbeitsverzeichnis im Container
WORKDIR /app WORKDIR /app
ENV PYTHONPATH="${PYTHONPATH}:/app:/app/utils"
# Kopiere Projektdateien für Abhängigkeitsmanagement # Kopiere Projektdateien für Abhängigkeitsmanagement
COPY . . COPY . .
...@@ -18,11 +19,8 @@ RUN uv venv .venv && \ ...@@ -18,11 +19,8 @@ RUN uv venv .venv && \
# Installiere die Abhängigkeiten aus pyproject.toml # Installiere die Abhängigkeiten aus pyproject.toml
RUN uv sync RUN uv sync
# Make entrypoint script executable
RUN chmod +x entrypoint.sh
# Exponiere Port 8000 (für Django) # Exponiere Port 8000 (für Django)
EXPOSE 8000 EXPOSE 8000
# Use entrypoint script # Startbefehl (z. B. für Django-Projekt)
CMD ["./entrypoint.sh"] CMD ["uv", "run", "sh", "-c", ".venv/bin/python manage.py migrate && .venv/bin/python manage.py runserver 0.0.0.0:8000"]
\ No newline at end of file
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
from utils.fluxQueryBuilder import FluxQueryBuilder from ...utils.fluxQueryBuilder import FluxQueryBuilder
from utils.influx import InfluxDBHelper from ...utils.influx import InfluxDBHelper
load_dotenv() load_dotenv()
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
...@@ -6,7 +6,7 @@ from django.shortcuts import render ...@@ -6,7 +6,7 @@ from django.shortcuts import render
from django.http import JsonResponse from django.http import JsonResponse
from django.views.decorators.csrf import ensure_csrf_cookie, csrf_protect from django.views.decorators.csrf import ensure_csrf_cookie, csrf_protect
import json import json
from utils.influx import InfluxDBHelper from ...utils.influx import InfluxDBHelper
from dotenv import load_dotenv from dotenv import load_dotenv
from django.views.decorators.http import require_http_methods from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment