# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set the working directory in the container
WORKDIR /app/src

# Copy over the requirements file and install dependencies
COPY ./requirements.txt /app
RUN pip install --upgrade pip && \
    apt-get update && \
    apt-get install -y gcc && \
    apt-get install -y python-dev-is-python3 && \
    pip install wheel && \
    pip install -r ../requirements.txt && \
    pip install tiktoken &&\
    pip install langdetect

# Copy .env file for github actions
COPY .env /app/src/.env


# Copy over the source
COPY ./src /app/src

# Expose the port the app runs on
EXPOSE 8000

# Define the default command to run
CMD ["uvicorn", "main:app", "--host", "0.0.0.0"]
