summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiogo Sousa <montezdesousa@gmail.com>2024-06-05 19:18:45 +0100
committerDiogo Sousa <montezdesousa@gmail.com>2024-06-05 19:18:45 +0100
commit2f7dbcdf4e8015692e837e9e5326e13c82002104 (patch)
tree805cb58a54919ac1973f722f4883ab58e819fc36
parenta52b24c16b3c59048ad94574cc2ff8d0b0784fce (diff)
feat: create cli dockerfile and update docs
-rw-r--r--build/docker/cli.dockerfile47
-rw-r--r--build/docker/platform.dockerfile (renamed from build/docker/api.dockerfile)4
-rw-r--r--website/content/cli/installation.md23
-rw-r--r--website/content/platform/installation.mdx11
4 files changed, 80 insertions, 5 deletions
diff --git a/build/docker/cli.dockerfile b/build/docker/cli.dockerfile
new file mode 100644
index 00000000000..4dec5e104a8
--- /dev/null
+++ b/build/docker/cli.dockerfile
@@ -0,0 +1,47 @@
+# ---- Base Python ----
+ FROM python:3.11-slim-bullseye AS base
+
+ # set work directory
+ WORKDIR /openbb
+
+ # set environment variables
+ ENV PYTHONDONTWRITEBYTECODE 1
+ ENV PYTHONUNBUFFERED 1
+
+ # install dependencies
+ RUN apt-get update \
+ && apt-get install -y --no-install-recommends build-essential openssh-client curl \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/*
+
+ # install toml and poetry
+ RUN pip install toml poetry
+
+ # ---- Copy Files/Build ----
+ FROM base AS builder
+
+ WORKDIR /openbb
+
+ # install Rust
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
+ && apt-get update \
+ && apt-get install -y --no-install-recommends libwebkit2gtk-4.0-dev \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/*
+
+ # add Rust to PATH
+ ENV PATH="/root/.cargo/bin:${PATH}"
+
+ COPY ./cli ./cli
+
+ # Install the SDK
+ RUN pip install /openbb/cli
+ RUN pip install openbb-devtools
+
+ # ---- Copy Files ----
+ FROM base
+
+ COPY --from=builder /usr/local /usr/local
+
+ # Launch OpenBB CLI
+ CMD ["openbb"]
diff --git a/build/docker/api.dockerfile b/build/docker/platform.dockerfile
index e8b7ac7e643..3bbfb2ae436 100644
--- a/build/docker/api.dockerfile
+++ b/build/docker/platform.dockerfile
@@ -34,7 +34,7 @@
COPY ./openbb_platform ./openbb_platform
- # Install the SDK
+ # Install the Platform
RUN pip install /openbb/openbb_platform[all]
RUN pip install openbb-devtools
@@ -43,5 +43,5 @@
COPY --from=builder /usr/local /usr/local
- # Specify the command to run
+ # Launch the API
CMD ["uvicorn", "openbb_core.api.rest_api:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
diff --git a/website/content/cli/installation.md b/website/content/cli/installation.md
index b26cb516659..3a551fb930b 100644
--- a/website/content/cli/installation.md
+++ b/website/content/cli/installation.md
@@ -50,7 +50,6 @@ Next, install webkit.
- Fedora: `sudo dnf install gtk3-devel webkit2gtk3-devel`
-
## PyPI
Within your existing OpenBB environment, install `openbb-cli` with:
@@ -67,6 +66,28 @@ openbb
Welcome to OpenBB Platform CLI v1.0.0
```
+## Docker
+
+You can install the Platform CLI from [GitHub Container Registry](https://github.com/orgs/OpenBB-finance/packages/container/package/openbb-cli) with:
+
+```bash
+docker run -it --rm -p 8000:8000 -v ~/.openbb_platform:/root/.openbb_platform ghcr.io/openbb-finance/openbb-cli:latest
+```
+
+Alternatively, we provide a `.dockerfile` on [GitHub](https://github.com/OpenBB-finance/OpenBBTerminal).
+
+Run the following command from the repo root to build the image:
+
+```bash
+docker build -f build/docker/cli.dockerfile -t openbb-cli:latest .
+```
+
+To run it:
+
+```bash
+docker run -it -v ~/.openbb_platform:/root/.openbb_platform openbb-platform:latest
+```
+
## Source
Follow the instructions [here](/platform/installation#source) to clone the GitHub repo and install the OpenBB Platform from the source code.
diff --git a/website/content/platform/installation.mdx b/website/content/platform/installation.mdx
index 4c34e21fb4e..379ba93c54b 100644
--- a/website/content/platform/installation.mdx
+++ b/website/content/platform/installation.mdx
@@ -168,12 +168,19 @@ pip uninstall openbb[all]
### Docker
<details>
-OpenBB provides a `.dockerfile` on [GitHub](https://github.com/OpenBB-finance/OpenBBTerminal).
+
+You can install and run the Platform from [GitHub Container Registry](https://github.com/OpenBB-finance/OpenBBTerminal/pkgs/container/openbb-platform) with:
+
+```bash
+docker run --rm -p 8000:8000 -v ~/.openbb_platform:/root/.openbb_platform ghcr.io/openbb-finance/openbb-platform:latest
+```
+
+Alternatively, we provide a `.dockerfile` on [GitHub](https://github.com/OpenBB-finance/OpenBBTerminal).
Run the following command from the repo root to build the image:
```bash
-docker build -f build/docker/api.dockerfile -t openbb-platform:latest .
+docker build -f build/docker/platform.dockerfile -t openbb-platform:latest .
```
To run it: