-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
91 lines (70 loc) · 2.83 KB
/
Copy pathDockerfile
File metadata and controls
91 lines (70 loc) · 2.83 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# ── Qute — Quantum Unified Threat Engine ─────────────────────────
# Base: NVIDIA CUDA-Q Python image (CUDA 12, Python 3.11)
# Falls back to standard Python 3.11 if no GPU available at build time.
#
# To build with GPU support:
# docker build --target gpu -t qute:latest .
# To build CPU-only (no CUDA required):
# docker build --target cpu -t qute:latest .
# ── CPU stage (always available) ─────────────────────────────────
FROM python:3.11-slim AS cpu
WORKDIR /app
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
nano \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
# cudaq excluded at CPU stage — installed conditionally at runtime
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
grep -v "^cudaq" requirements.txt > requirements-cpu.txt && \
pip install --no-cache-dir -r requirements-cpu.txt && pip install --no-cache-dir pytz numpy && pip install pytz numpy
# Copy application source
COPY config.py .
COPY src/ ./src/
COPY data/ ./data/
COPY vendor/ ./vendor/
# Create default DB directory
RUN mkdir -p /root/.qute
# Expose Streamlit port
EXPOSE 8501
# Expose Syslog port
EXPOSE 5514
#COPY rsyslog.conf /etc/rsyslog.conf
# Initialise schema on startup, then launch UI
CMD ["sh", "-c", \
"python3 -c 'import sys; sys.path.insert(0,\".\"); sys.path.insert(0,\"./src\"); from store.schema import initialise; initialise()' && \
streamlit run src/ui/app.py --server.port=8501 --server.address=0.0.0.0"]
# ── GPU stage (requires NVIDIA Container Toolkit on host) ─────────
FROM nvidia/cuda:12.5.0-runtime-ubuntu22.04 AS gpu
WORKDIR /app
# System dependencies + Python 3.11
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
python3.11 \
python3.11-dev \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Make python3.11 the default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Install Python dependencies including cudaq with GPU support
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir pytz numpy cudaq==0.14.0
# Copy application source
COPY config.py .
COPY src/ ./src/
COPY data/ ./data/
COPY vendor/ ./vendor/
RUN mkdir -p /root/.qute
EXPOSE 8501
CMD ["sh", "-c", \
"python3 -c 'import sys; sys.path.insert(0,\".\"); sys.path.insert(0,\"./src\"); from store.schema import initialise; initialise()' && \
streamlit run src/ui/app.py --server.port=8501 --server.address=0.0.0.0"]