# Build:
# docker build -t myapp .

# Run:
# docker run -p 8000:8000 myapp

# Use Python 3.13.7 base image
FROM python:3.13.7-slim

# Set working directory
WORKDIR /app

# Install dependencies for opentelemetry + ngrok
RUN pip install --no-cache-dir \
    opentelemetry-distro \
    opentelemetry-instrumentation \
    opentelemetry-exporter-otlp \
    pyngrok

# Copy project files
COPY . .

# Install Python dependencies from requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Download model at build time
RUN python downloadModel.py

# Expose FastAPI/Flask/HTTP server port
EXPOSE 8000

# Copy entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Default command: run script
CMD ["/entrypoint.sh"]
