FROM python:3.13-alpine WORKDIR /app # Install dependencies RUN apk add --no-cache \ rrdtool \ rrdtool-dev \ gcc \ musl-dev \ python3-dev \ libffi-dev \ openssl-dev \ wget # Copy requirements first (better caching) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY app.py . COPY config.py . COPY collector.py . COPY rrd_manager.py . # Copy static files and templates COPY static/ ./static/ COPY templates/ ./templates/ # Create RRD directory RUN mkdir -p /data/rrd ENV LISTEN_PORT=8080 EXPOSE $LISTEN_PORT # Run app CMD ["python", "app.py"]