Initial Meterbox commit with boot disk usage metric.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
4e44204d9b
55 files changed
+12104
No files matched your search
+33
@@ -0,0 +1,33 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM node:22-bookworm AS frontend
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend/ ./
|
||||
RUN npm run build
|
||||
|
||||
FROM rust:1-bookworm AS backend
|
||||
WORKDIR /app/backend
|
||||
COPY backend/Cargo.toml backend/Cargo.lock ./
|
||||
RUN mkdir src && echo 'fn main(){}' > src/main.rs && cargo build --release && rm -rf src
|
||||
COPY backend/src ./src
|
||||
RUN touch src/main.rs && cargo build --release
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates vnstat \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /app
|
||||
COPY --from=backend /app/backend/target/release/meterbox /usr/local/bin/meterbox
|
||||
COPY --from=frontend /app/frontend/dist /app/frontend/dist
|
||||
RUN mkdir -p /app/data
|
||||
ENV METERBOX_LISTEN=127.0.0.1:8787 \
|
||||
METERBOX_DB=/app/data/meterbox.db \
|
||||
METERBOX_STATIC=/app/frontend/dist \
|
||||
METERBOX_INTERVAL_SECS=30 \
|
||||
METERBOX_RETENTION_DAYS=90 \
|
||||
METERBOX_BWFLOW_SOCK=/run/bwflow/bwflow.sock
|
||||
EXPOSE 8787
|
||||
VOLUME ["/app/data"]
|
||||
CMD ["meterbox"]
|
||||
Reference in new issue
Block a user