FROM python:3.10-slim-buster

WORKDIR /app

RUN ls

RUN apt-get update && \
apt-get install -y --no-install-recommends git build-essential libffi-dev cmake libcurl4-openssl-dev

RUN git clone https://github.com/xAbdoAT/ChimeraGPT-WebUI.git

COPY ../ChimeraGPT-WebUI/translations translations

COPY requirements.txt requirements.txt

RUN python -m venv venv

ENV PATH="/app/venv/bin:$PATH"

RUN python -m pip install --upgrade pip && \
python -m pip install --no-cache-dir -r requirements.txt

RUN python -m pip install flask

RUN python -m pip install flask_babel

COPY . .

RUN chmod -R 777 /app/ChimeraGPT-WebUI
RUN chmod +x ./ChimeraGPT-WebUI/run.py

EXPOSE 8080

CMD ["python3", "./ChimeraGPT-WebUI/run.py"]