FROM ubuntu:22.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt update \
 && apt install ca-certificates python3 python3-pip php8.1-cli php8.1-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 pip install --upgrade pip
RUN pip3 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 pip3 install .[test] --no-cache-dir
CMD ["pytest"]
