-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
56 lines (43 loc) · 1.49 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
50
51
52
53
54
55
56
# Start with the latest Node.js base image
FROM node:21.5-bookworm-slim as builder
# Install Python and any necessary dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
# Configure Poetry
ENV POETRY_VERSION=1.6.1
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
# Set the working directory
WORKDIR /app
# Install dependencies including MkDocs
COPY poetry.lock pyproject.toml ./
RUN poetry install --no-root
# Copy the flask app to the working directory
COPY . /app
#RUN poetry run python runner.py --convert snort
RUN poetry run python runner.py --convert et
RUN poetry run python runner.py --convert custom
# Uncomment the following line if you want to run conversion for suricata
# RUN poetry run python runner.py --convert suricata
RUN poetry run python bin/cvereport.py
# Build the site with MkDocs
WORKDIR /app/Magic-SigExplorer
RUN poetry run mkdocs build
# Use Nginx for serving
FROM nginx:alpine
# Copy static files to Nginx directory
COPY --from=builder /app/Magic-SigExplorer/site/ /usr/share/nginx/html
# Expose port for the application
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]