summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanglewood <85772166+deeleeramone@users.noreply.github.com>2024-05-01 16:08:44 -0700
committerGitHub <noreply@github.com>2024-05-01 16:08:44 -0700
commit150032ec300b9b2f6ea287d1faee061ead8d5a0d (patch)
tree9cb5c13d6c950f6d1e05b7eb39a13c06f77ad09c
parenta0d580ab25f91657b05acdadc47cd0999de102c7 (diff)
restore platform api docker file
-rw-r--r--openbb_platform/api.dockerfile47
1 files changed, 47 insertions, 0 deletions
diff --git a/openbb_platform/api.dockerfile b/openbb_platform/api.dockerfile
new file mode 100644
index 00000000000..c384555f9f8
--- /dev/null
+++ b/openbb_platform/api.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 ./openbb_platform ./openbb_platform
+
+# Install the SDK
+RUN pip install /openbb/openbb_platform[all]
+RUN pip install openbb-devtools
+
+# ---- Copy Files ----
+FROM base
+
+COPY --from=builder /usr/local /usr/local
+
+# Specify the command to run
+CMD ["uvicorn", "openbb_core.api.rest_api:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]