-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (37 loc) · 1.62 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (37 loc) · 1.62 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
# ─── Build Stage ─────────────────────────────────────────────────────────────
FROM ubuntu:24.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
libssl-dev \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . /build/marble
RUN cd /build/marble/LinuxPort && \
make -j$(nproc) && \
cp mibster mender validator /build/
# ─── Runtime Stage ───────────────────────────────────────────────────────────
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
ENV PIP_NO_CACHE_DIR=1
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /build/mibster /build/mender /build/validator /app/LinuxPort/
COPY --from=builder /build/marble/LinuxPort/Shared /app/LinuxPort/Shared
COPY ml/ /app/ml/
COPY marble /app/marble
COPY README.md /app/README.md
COPY docs/ /app/docs/
RUN chmod +x /app/marble && \
pip install --no-cache-dir flask fastapi uvicorn pydantic
ENV MARBLE_ROOT=/app
ENV PATH="/app:/app/LinuxPort:${PATH}"
EXPOSE 5000 8080
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python3 -c "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/v1/health')" || exit 1
ENTRYPOINT ["/app/marble"]
CMD ["api", "--port", "5000", "--host", "0.0.0.0"]