-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (47 loc) · 1.68 KB
/
Dockerfile
File metadata and controls
62 lines (47 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 1. Define the builder image
FROM python:3.13-slim AS builder
# 2. Set working directory
WORKDIR /app
# 3. Install system dependencies for python build
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
libxml2-dev \
libxslt-dev \
&& rm -rf /var/lib/apt/lists/*
# 4. Copy metadata files
COPY pyproject.toml README.md LICENSE ./
# 5. Create skeleton to cache dependencies
RUN mkdir recongraph && touch recongraph/__init__.py
# 6. Install dependencies into a separate prefix to cache heavy dependencies
RUN pip install --no-cache-dir --prefix=/install .
# 7. Define runtime python image
FROM python:3.13-slim
# 8. Set working directory
WORKDIR /app
# 9. Copy the installed libraries from the builder
COPY --from=builder /install /usr/local
# 10. Install runtime-only system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libxml2 \
wget \
ca-certificates \
unzip \
&& rm -rf /var/lib/apt/lists/*
# 11. Copy actual source code and metadata
COPY pyproject.toml README.md LICENSE ./
COPY recongraph/ ./recongraph/
# 12. Install the package (linking the source code)
RUN pip install --no-cache-dir -e .
# 13. Get Core Sigma Package
RUN wget https://github.com/SigmaHQ/sigma/releases/download/r2026-01-01/sigma_core.zip -O /tmp/sigma.zip && \
unzip /tmp/sigma.zip -d /tmp && \
mkdir -p /app/sigma && \
mv /tmp/rules/* /app/sigma/ && \
rm -rf /tmp/sigma.zip /tmp/rules /tmp/version.txt
# 14. Set default sigma path
ENV SIGMA_RULES_PATH=/app/sigma
# 15. Create data directory and set it as final WORKDIR
RUN mkdir -p /app/data
WORKDIR /app/data
# 16. Set entrypoint for docker
ENTRYPOINT ["recongraph"]