Skip to content

Commit

Permalink
Dockerfile updated to work with openbb-chat
Browse files Browse the repository at this point in the history
The previously Dockerfile has been updated to work with the openbb-chat
version downloaded from PyPI.
  • Loading branch information
Dedalo314 committed Aug 29, 2023
1 parent 6dd7686 commit a36574e
Showing 1 changed file with 8 additions and 38 deletions.
46 changes: 8 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,21 @@ FROM nvidia/cuda:11.7.1-devel-ubuntu22.04
# Update system
RUN apt update && apt install -y python3-pip python3-venv

# Configure Poetry
ENV POETRY_VERSION=1.5.1
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache

# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}

# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"

WORKDIR /openbb-chat/

# Add dependencies
ADD poetry.lock /openbb-chat/poetry.lock
ADD pyproject.toml /openbb-chat/pyproject.toml

# Install fastapi and uvicorn for running the fastapi app
RUN poetry add fastapi uvicorn

RUN poetry install --no-root
ADD openbb_chat /openbb-chat/openbb_chat
ADD README.md /openbb-chat/README.md
RUN poetry install --only-root

#Install graphical tool to avoid interaction
RUN apt install -y libwebkit2gtk-4.0-dev

# Add other files
ADD scripts /openbb-chat/scripts/
ADD data /openbb-chat/data/

# Create app directory
RUN mkdir -p /openbb-chat/fastapi
# Install requirements.txt
COPY ./requirements.txt /api/requirements.txt
WORKDIR /api
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install -r requirements.txt

# Copy FastAPI app
COPY ./fastapi /openbb-chat/fastapi

WORKDIR /openbb-chat/fastapi
COPY ./fastapi /api/fastapi
WORKDIR /api/fastapi

# Expose port for FastAPI app to run on
EXPOSE 8000

# Run the FastAPI app
CMD ["poetry", "run", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--env-file", ".env"]

0 comments on commit a36574e

Please sign in to comment.