FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive PYTHONUNBUFFERED=1 NETMON_LICENSE_FILE=/data/license.key
RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip snmp ca-certificates tzdata \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
COPY wheels ./wheels
RUN pip3 install --no-cache-dir --find-links wheels -r requirements.txt
COPY . .
RUN sed -e 's#host=127.0.0.1#host=db#' -e 's#base_url: .*#base_url: "http://localhost:8080"#' \
        -e '/^mail:/,/^[a-z]/ s/enabled: true/enabled: false/' config/config.example.yaml > config/config.yaml \
    && chmod +x docker/*.sh && mkdir -p /data
