FROM python:3.10-slim

# Set Python to run in unbuffered mode for better logging
ENV PYTHONUNBUFFERED=1

# Install base dependencies
RUN apt-get update && apt-get install -y \
    g++ \
    default-jdk-headless \
    php-cli \
    mono-mcs \
    mono-runtime \
    libmono-system-numerics4.0-cil \
    bash \
    nodejs \
    npm \
    && rm -rf /var/lib/apt/lists/*

# Install common Python dependencies and those needed for tests(adherence checks)
RUN pip install --no-cache-dir \
    numpy \
    pandas \
    scikit-learn \
    scipy \
    langdetect \
    PyExecJS \
    sacrebleu \
    datasketch \
    func_timeout \
    pyahocorasick

# Install TypeScript globally
RUN npm install -g typescript

WORKDIR /app

# Install Node.js types locally so tsc can find them
RUN npm init -y && npm install --save-dev @types/node
