FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update \
 && apt install ca-certificates python3 python3-venv python3-pip php8.3-cli php8.3-xml sslscan -y --no-install-recommends \
 && apt clean -yq \
 && apt autoremove -yq \
 && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
 && truncate -s 0 /var/log/*log

RUN update-ca-certificates
RUN python3 -c "import sys; print(sys.version)"
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --upgrade pip
RUN pip install -U setuptools --no-cache-dir
RUN mkdir /usr/src/app

ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8

WORKDIR /usr/src/app

COPY . .

RUN pip install .[test] --no-cache-dir
CMD ["pytest"]
