mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
Vscode/Github Codespaces dev container (#4975)
* vscode/Github Codespaces dev container * move badge to new line * actually move badge to new line --------- Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
79
.devcontainer/Dockerfile
vendored
Normal file
79
.devcontainer/Dockerfile
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# SETUP PYTHON IMAGE
|
||||
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye AS python
|
||||
|
||||
LABEL org.opencontainers.image.source https://github.com/OpenBB-finance/OpenBBTerminal
|
||||
|
||||
# SETUP DEBIAN IMAGE
|
||||
FROM python as debian
|
||||
|
||||
RUN apt-get update
|
||||
|
||||
RUN apt-get -y install --no-install-recommends \
|
||||
gcc \
|
||||
g++ \
|
||||
make
|
||||
|
||||
RUN apt-get -y install --no-install-recommends \
|
||||
git
|
||||
|
||||
RUN apt-get -y install --no-install-recommends \
|
||||
curl \
|
||||
wget
|
||||
|
||||
RUN apt-get -y install --no-install-recommends \
|
||||
libsm6 \
|
||||
libxt6 \
|
||||
libgl1-mesa-glx \
|
||||
libpng16-16 \
|
||||
libwebkit2gtk-4.0-dev \
|
||||
build-essential \
|
||||
libssl-dev \
|
||||
librsvg2-dev \
|
||||
ffmpeg \
|
||||
python3-tk
|
||||
|
||||
RUN apt-get clean
|
||||
|
||||
USER vscode
|
||||
WORKDIR /home/vscode
|
||||
|
||||
# SETUP POETRY IMAGE
|
||||
FROM debian as poetry
|
||||
|
||||
ENV PATH="/home/vscode/.local/bin:${PATH}"
|
||||
|
||||
# Define the version of Poetry to install (default is 1.4.2)
|
||||
# Define the directory of python virtual environment
|
||||
ARG PYTHON_VIRTUALENV_HOME=/home/vscode/openbb-py-env \
|
||||
POETRY_VERSION=1.4.0
|
||||
|
||||
ENV POETRY_VIRTUALENVS_IN_PROJECT=false \
|
||||
POETRY_NO_INTERACTION=true
|
||||
|
||||
# Create a Python virtual environment for Poetry and install it
|
||||
RUN python3 -m venv ${PYTHON_VIRTUALENV_HOME} && \
|
||||
$PYTHON_VIRTUALENV_HOME/bin/pip install --upgrade pip wheel && \
|
||||
$PYTHON_VIRTUALENV_HOME/bin/pip install poetry==${POETRY_VERSION}
|
||||
|
||||
ENV PATH="$PYTHON_VIRTUALENV_HOME/bin:$PATH" \
|
||||
VIRTUAL_ENV=$PYTHON_VIRTUALENV_HOME
|
||||
|
||||
# Setup for bash
|
||||
RUN poetry completions bash >> /home/vscode/.bash_completion && \
|
||||
echo "export PATH=$PYTHON_VIRTUALENV_HOME/bin:$PATH" >> ~/.bashrc
|
||||
|
||||
# SETUP OPENBB IMAGE
|
||||
FROM poetry as openbb-dev
|
||||
|
||||
COPY --chown=vscode:vscode pyproject.toml poetry.lock ./
|
||||
|
||||
RUN mkdir OpenBBUserData
|
||||
RUN chown vscode:vscode OpenBBUserData
|
||||
|
||||
RUN mkdir .openbb_terminal
|
||||
RUN chown vscode:vscode .openbb_terminal
|
||||
|
||||
RUN poetry install --no-root --extras optimization --extras forecast
|
||||
|
||||
# Set the working directory for the app
|
||||
WORKDIR /workspaces/openbb
|
||||
33
.devcontainer/devcontainer.json
vendored
Normal file
33
.devcontainer/devcontainer.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
|
||||
{
|
||||
"dockerComposeFile": "./docker-compose.yaml",
|
||||
"service": "openbb",
|
||||
"workspaceFolder": "/workspaces/openbb",
|
||||
"name": "openbb",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"ms-python.python"
|
||||
],
|
||||
"settings": {
|
||||
"python.defaultInterpreterPath": "/home/vscode/openbb-py-env/bin/python"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
"features": {},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [],
|
||||
|
||||
// Uncomment the next line to run commands after the container is created.
|
||||
// "postCreateCommand": "cat /etc/os-release",
|
||||
|
||||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "devcontainer"
|
||||
"remoteUser": "vscode",
|
||||
"overrideCommand": true
|
||||
}
|
||||
11
.devcontainer/docker-compose.yaml
vendored
Normal file
11
.devcontainer/docker-compose.yaml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
openbb:
|
||||
volumes:
|
||||
- ~/OpenBBUserData:/home/vscode/OpenBBUserData
|
||||
- ~/.openbb_terminal:/home/vscode/.openbb_terminal
|
||||
- ../:/workspaces/openbb
|
||||
platform: linux/amd64
|
||||
build:
|
||||
dockerfile: .devcontainer/Dockerfile
|
||||
context: ../
|
||||
4
README.md
vendored
4
README.md
vendored
@@ -23,6 +23,10 @@
|
||||

|
||||
[](https://twitter.com/openbb_finance)
|
||||
|
||||
[](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/OpenBB-finance/OpenBBTerminal)
|
||||
|
||||
[](https://codespaces.new/OpenBB-finance/OpenBBTerminal)
|
||||
|
||||
<!-- PROJECT LOGO -->
|
||||
|
||||
| OpenBB is committed to build the future of investment research by focusing on an open source infrastructure accessible to everyone, everywhere. |
|
||||
|
||||
Reference in New Issue
Block a user