Skip to content

Commit

Permalink
refactor, add healthz, efficiency and robustness
Browse files Browse the repository at this point in the history
  • Loading branch information
sholdee committed Jun 27, 2024
1 parent 19d8134 commit c858fc9
Show file tree
Hide file tree
Showing 3 changed files with 258 additions and 134 deletions.
22 changes: 21 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
FROM python:3-slim
FROM python:3-alpine

WORKDIR /app

# Install build dependencies
RUN apk add --no-cache --virtual .build-deps gcc musl-dev

# Copy and install requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Remove build dependencies
RUN apk del .build-deps

# Copy the script
COPY adguard_exporter.py .

# Expose the metrics port
EXPOSE 8000

# Set environment variables (can be overridden at runtime)
ENV LOG_FILE_PATH=/adguard/work/data/querylog.json
ENV METRICS_PORT=8000
ENV UPDATE_INTERVAL=10

# Run the exporter
CMD ["python", "./adguard_exporter.py"]
Loading

0 comments on commit c858fc9

Please sign in to comment.