From fd0b28f041b6a81788cd0d5b11c631a84d487400 Mon Sep 17 00:00:00 2001 From: fardin-developer Date: Fri, 17 Jan 2025 22:37:21 +0530 Subject: [PATCH 1/3] docker added --- Dockerfile | 16 ++++++++++++++++ requirements.txt | 1 + 2 files changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3d7879e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.11-slim + +WORKDIR /app + +COPY requirements.txt . + +RUN pip install --no-cache-dir -r requirements.txt + +COPY . . + +RUN chmod +x /app/agentic_security.py || true + +EXPOSE 8718 + +# Run the initialization command first, then start the application +CMD ["sh", "-c", "python -m agentic_security i && python -m agentic_security s"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index aa7b71e..d6cece5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,4 @@ cache_to_disk # datasets loguru pandas +agentic_security \ No newline at end of file From a6c149f4778b32a5ec61e767ff80f786caa2ed75 Mon Sep 17 00:00:00 2001 From: fardin-developer Date: Sat, 18 Jan 2025 01:29:47 +0530 Subject: [PATCH 2/3] update Dockerfile to use Poetry for direct dependency management --- Dockerfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3d7879e..39679df 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,15 +2,22 @@ FROM python:3.11-slim WORKDIR /app -COPY requirements.txt . +RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir -r requirements.txt +RUN curl -sSL https://install.python-poetry.org | python3 - + +# Ensure Poetry is available in PATH +ENV PATH="/root/.local/bin:$PATH" + +COPY pyproject.toml poetry.lock ./ + +RUN poetry self add "poetry-plugin-export" && \ + poetry export -f requirements.txt --without-hashes -o requirements.txt && \ + pip install --no-cache-dir -r requirements.txt COPY . . -RUN chmod +x /app/agentic_security.py || true - EXPOSE 8718 # Run the initialization command first, then start the application -CMD ["sh", "-c", "python -m agentic_security i && python -m agentic_security s"] \ No newline at end of file +# CMD ["sh", "-c", "python -m agentic_security i && python -m agentic_security s"] From 724ad1574b0d341470442e308d232f57a8bcbea5 Mon Sep 17 00:00:00 2001 From: fardin-developer Date: Sat, 18 Jan 2025 19:38:36 +0530 Subject: [PATCH 3/3] docker ignore added, and code cleaned --- .dockerignore | 2 ++ Dockerfile | 5 ----- requirements.txt | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..110e416 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git/ +__pycache__/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 39679df..4315c14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,8 +16,3 @@ RUN poetry self add "poetry-plugin-export" && \ pip install --no-cache-dir -r requirements.txt COPY . . - -EXPOSE 8718 - -# Run the initialization command first, then start the application -# CMD ["sh", "-c", "python -m agentic_security i && python -m agentic_security s"] diff --git a/requirements.txt b/requirements.txt index d6cece5..a423483 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,5 +7,4 @@ httpx cache_to_disk # datasets loguru -pandas -agentic_security \ No newline at end of file +pandas \ No newline at end of file