Files
leox-gpon-monitoring/Dockerfile
Mateusz Gruszczyński ca3cc57773 release
2026-01-02 22:57:07 +01:00

38 lines
738 B
Docker

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 ["sh", "-c", "gunicorn --bind 0.0.0.0:${LISTEN_PORT} --workers 1 --threads 2 --access-logfile - --error-logfile - app:app"]