From 15310b8df72fe8e5819776a4c473bfca1c73b52d Mon Sep 17 00:00:00 2001 From: Akashdeep Dhar Date: Mar 05 2021 05:58:04 +0000 Subject: Added compose configuration for including Redis store Defaulted data storage to once per 10 seconds for 6 hours (2160 records) Signed-off-by: Akashdeep Dhar --- diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 3dee24a..0000000 --- a/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM python:3.8-alpine -ENV PYTHONUNBUFFERED=1 -WORKDIR /supervisor-driver-service -COPY . . -RUN apk add --no-cache docker gcc musl-dev linux-headers -RUN pip install -r requirements.txt -EXPOSE 8888 6969 -ENTRYPOINT ["python3", "falc.py", "-p", "8888", "-s", "6969", "-4"] diff --git a/datafile b/datafile new file mode 100644 index 0000000..605c18b --- /dev/null +++ b/datafile @@ -0,0 +1,2 @@ +FROM redis:alpine +EXPOSE 6379 diff --git a/docker-compose.yml b/docker-compose.yml index c434120..bf827be 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,9 @@ version: "3.8" services: endpoint: - build: . + build: + context: . + dockerfile: edptfile entrypoint: "python3 falc.py -p 8888 -s 6969 -4" ports: - "8888:8888" @@ -9,3 +11,7 @@ services: volumes: - ".:/supervisor-driver-service" - "/var/run/docker.sock:/var/run/docker.sock" + storaged: + build: + context: . + dockerfile: datafile diff --git a/edptfile b/edptfile new file mode 100644 index 0000000..3dee24a --- /dev/null +++ b/edptfile @@ -0,0 +1,8 @@ +FROM python:3.8-alpine +ENV PYTHONUNBUFFERED=1 +WORKDIR /supervisor-driver-service +COPY . . +RUN apk add --no-cache docker gcc musl-dev linux-headers +RUN pip install -r requirements.txt +EXPOSE 8888 6969 +ENTRYPOINT ["python3", "falc.py", "-p", "8888", "-s", "6969", "-4"] diff --git a/falc.py b/falc.py index 250f62b..6b9f095 100644 --- a/falc.py +++ b/falc.py @@ -118,7 +118,7 @@ class ConnectionExaminationEndpoint(object): "--recsqant", "recsqant", help="Set the number of maintained records.", - default=1000 + default=2160 ) @click.option( "-4", diff --git a/requirements.txt b/requirements.txt index 6fcd6c4..f1743ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ falcon==2.0.0 idna==2.10 psutil==5.8.0 ptyprocess==0.7.0 +redis==3.5.3 requests==2.25.1 six==1.15.0 tornado==6.1