Files
firegex-traffic-viewer/Dockerfile

50 lines
1.8 KiB
Docker
Raw Normal View History

# Firegex Dockerfile UUID signature
# cf1795af-3284-4183-a888-81ad3590ad84
2025-09-15 10:22:47 +02:00
# Needed for run.py to detect the Dockerfile
2024-10-13 01:50:52 +02:00
FROM --platform=$BUILDPLATFORM oven/bun AS frontend
2022-08-03 13:44:30 +02:00
WORKDIR /app
ADD ./frontend/package.json .
2025-02-02 20:42:01 +01:00
ADD ./frontend/bun.lock .
RUN bun i
2022-08-03 13:44:30 +02:00
COPY ./frontend/ .
RUN bun run build
2022-08-03 13:44:30 +02:00
# Base fedora container
2025-10-13 15:38:38 +02:00
FROM --platform=$TARGETARCH quay.io/fedora/fedora:43 AS base
RUN dnf -y update && dnf install -y python3.14 libnetfilter_queue \
libnfnetlink libmnl libcap-ng-utils nftables \
vectorscan libtins python3-nftables libpcap && dnf clean all
2022-07-19 17:56:54 +02:00
RUN mkdir -p /execute/modules
2022-06-11 21:57:50 +02:00
WORKDIR /execute
FROM --platform=$TARGETARCH base AS compiler
2025-10-13 15:38:38 +02:00
RUN dnf -y update && dnf install -y python3.14-devel @development-tools gcc-c++ \
2025-09-28 22:25:26 +02:00
libnetfilter_queue-devel libnfnetlink-devel libmnl-devel \
vectorscan-devel libtins-devel libpcap-devel boost-devel
COPY ./backend/binsrc /execute/binsrc
RUN g++ binsrc/nfregex.cpp -o cppregex -std=c++23 -O3 -lnetfilter_queue -pthread -lnfnetlink $(pkg-config --cflags --libs libtins libhs libmnl)
2025-10-13 15:38:38 +02:00
RUN g++ binsrc/nfproxy.cpp -o cpproxy -std=c++23 -O3 -lnetfilter_queue -lpython3.14 -pthread -lnfnetlink $(pkg-config --cflags --libs libtins libmnl python3)
#Building main conteiner
FROM --platform=$TARGETARCH base AS final
COPY ./backend/requirements.txt /execute/requirements.txt
2025-03-07 18:22:18 +01:00
COPY ./fgex-lib /execute/fgex-lib
2025-10-13 15:38:38 +02:00
RUN dnf -y update && dnf install -y gcc-c++ python3.14-devel uv git &&\
uv pip install --no-cache --system ./fgex-lib &&\
uv pip install --no-cache --system -r /execute/requirements.txt &&\
2025-10-13 15:38:38 +02:00
uv cache clean && dnf remove -y gcc-c++ python3.14-devel uv git && dnf clean all
2022-07-17 10:36:14 +02:00
2022-06-28 16:02:52 +02:00
COPY ./backend/ /execute/
COPY --from=compiler /execute/cppregex /execute/cpproxy /execute/modules/
2023-06-05 00:55:38 +02:00
COPY --from=frontend /app/dist/ ./frontend/
CMD ["/bin/sh", "/execute/docker-entrypoint.sh"]