-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 706 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 706 Bytes
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
FROM python:3.11-slim
LABEL maintainer="Media Services Exporter"
LABEL description="Prometheus exporter for Radarr, Sonarr, and Jellyfin"
# Set working directory
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy exporter script
COPY exporter.py .
# Create non-root user
RUN useradd -m -u 1000 exporter && \
chown -R exporter:exporter /app
USER exporter
# Expose metrics port
EXPOSE 9877
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:9877')" || exit 1
# Run exporter
CMD ["python", "-u", "exporter.py"]