FROM python:3.10

WORKDIR /app

# Install system dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends pkg-config && \
    apt-get install -y --no-install-recommends build-essential \
        libssl-dev \
        libffi-dev \
        python3-dev \
        libpng-dev \
        libfreetype6-dev && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

RUN  ln -s /usr/include/freetype2/ft2build.h /usr/include/
# Copy the requirements.txt file into the container
COPY requirements.txt .

# Install the required packages
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install pytest
# 4. Copy the API code
COPY athena /app/athena
COPY plugins /app/plugins
COPY tests /app/tests
COPY pyproject.toml /app
COPY README.md /app
RUN pip install -e .
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]