-
Notifications
You must be signed in to change notification settings - Fork 36
/
Dockerfile
49 lines (42 loc) · 1.3 KB
/
Dockerfile
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
FROM python:3.10-slim
# Set the working directory in the container
WORKDIR /app
# Install the necessary build tools, dependencies, git, git-lfs, and YARA prerequisites
RUN apt-get update && apt-get install --no-install-recommends -y \
automake \
autoconf \
build-essential \
libtool \
libc-dev \
make \
flex \
gcc \
pkg-config \
libssl-dev \
curl \
unzip \
git \
git-lfs \
bison \
&& rm -rf /var/lib/apt/lists/*
# Download and install YARA from source
RUN echo "Installing YARA from source ..." \
&& curl -Lo yara.zip https://github.com/VirusTotal/yara/archive/refs/tags/v4.3.2.zip \
&& unzip yara.zip \
&& cd yara-4.3.2 \
&& ./bootstrap.sh \
&& ./configure \
&& make \
&& make install \
&& make check
# Copy vigil into the container
COPY . .
# Install Python dependencies including PyTorch CPU
RUN echo "Installing Python dependencies ... " \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir torch==2.1.1+cpu torchvision==0.16.1+cpu --index-url https://download.pytorch.org/whl/cpu
# Expose port 5000 for the API server
EXPOSE 5000
COPY scripts/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh", "python", "vigil-server.py", "-c", "conf/server.conf"]