FROM python:3.12-slim
ARG INSTALL_GCC

ENV LANG=C.UTF-8 \
    LC_ALL=C.UTF-8

RUN apt-get update && apt-get install -y --no-install-recommends \
    locales \
    vim \
    iputils-ping \
    && locale-gen en_US.UTF-8 \
    && if [ "$INSTALL_GCC" = "true" ]; then \
        apt-get install -y --no-install-recommends build-essential curl; \
    fi \
    && apt-get clean && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir unidecode

# PARTE ESPECIFICA DA IMAGEM
WORKDIR /app
RUN mkdir /app/logs
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY src .

CMD [ "python", "endpoint_listener.py"]
