Add Dockerfile

This commit is contained in:
2026-03-05 19:26:11 +00:00
parent 39803d5184
commit 906475d978
+22
View File
@@ -0,0 +1,22 @@
FROM python:3.12-slim
# Install a few basics (certs for HTTPS, curl for healthchecks/debug)
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY bgw210-700_prom_collector.py /app/bgw210-700_prom_collector.py
# Optional: run as a non-root user
RUN useradd -r -u 10001 appuser && chown -R appuser:appuser /app
USER appuser
EXPOSE 8000
# Defaults; Compose can override via environment/command
CMD ["python", "/app/bgw210-700_prom_collector.py", "--ip", "192.168.1.254", "--port", "8000"]