From 71bc31d0bd7952616025aa820f087b8e203e169b Mon Sep 17 00:00:00 2001 From: the Date: Wed, 4 Dec 2024 21:33:02 +0400 Subject: [PATCH] containers test --- GreenhouseDetector/Dockerfile | 11 +++++++++++ GreenhouseManager/Dockerfile | 11 +++++++++++ docker-compose.yml | 18 ++++++++++++++++++ requirements.txt | 3 +++ 4 files changed, 43 insertions(+) create mode 100644 GreenhouseDetector/Dockerfile create mode 100644 GreenhouseManager/Dockerfile create mode 100644 requirements.txt diff --git a/GreenhouseDetector/Dockerfile b/GreenhouseDetector/Dockerfile new file mode 100644 index 0000000..cb846ca --- /dev/null +++ b/GreenhouseDetector/Dockerfile @@ -0,0 +1,11 @@ +FROM python:latest + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +COPY GreenhouseDetector/detector.py . + +CMD ["python", "detector.py"] \ No newline at end of file diff --git a/GreenhouseManager/Dockerfile b/GreenhouseManager/Dockerfile new file mode 100644 index 0000000..efc49af --- /dev/null +++ b/GreenhouseManager/Dockerfile @@ -0,0 +1,11 @@ +FROM python:latest + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +COPY GreenhouseManager/manager.py . + +CMD ["python", "manager.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a1e5c42..665e246 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,3 +78,21 @@ services: KAFKA_CLUSTERS_0_NAME: local KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092 KAFKA_CLUSTERS_0_METRICS_PORT: 9997 + + #manager_py_service: + # container_name: manager_py + # build: + # context: . + # dockerfile: ./GreenhouseManager/Dockerfile + # depends_on: + # - kafka + + #detector_py_service: + # container_name: detector_py + # build: + # context: . + # dockerfile: ./GreenhouseDetector/Dockerfile + # depends_on: + # - kafka + # expose: + # - 20002 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0145355 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +kafka-python~=2.0.2 +Flask~=3.0.3 +requests~=2.31.0 \ No newline at end of file