| |
| |
| |
| |
| |
| |
|
|
| |
| FROM node:20-slim AS frontend |
| WORKDIR /fe |
| COPY ai-hedge-fund/app/frontend/package.json ai-hedge-fund/app/frontend/package-lock.json* ./ |
| RUN npm ci || npm install |
| COPY ai-hedge-fund/app/frontend/ ./ |
| |
| RUN rm -f .env.local && printf 'VITE_API_URL=/api\n' > .env.production \ |
| && (npm run build || npx vite build) |
|
|
| |
| FROM python:3.11-slim-bookworm AS runtime |
| ENV DEBIAN_FRONTEND=noninteractive |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| curl ca-certificates git unzip xz-utils build-essential python3-dev \ |
| supervisor libstdc++6 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY --from=oven/bun:1 /usr/local/bin/bun /usr/local/bin/bun |
|
|
| |
| RUN curl -fsSL "https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux" \ |
| -o /usr/local/bin/lightpanda && chmod +x /usr/local/bin/lightpanda |
|
|
| |
| RUN useradd -m -u 1000 user |
| ENV HOME=/home/user |
| WORKDIR /app |
|
|
| |
| RUN python3 -m venv /opt/venv-openbb \ |
| && /opt/venv-openbb/bin/pip install --no-cache-dir -U pip \ |
| && /opt/venv-openbb/bin/pip install --no-cache-dir "openbb==4.7.2" "openbb-platform-api" \ |
| && /opt/venv-openbb/bin/python -c "import openbb; print('openbb build ok')" |
|
|
| |
| COPY ai-hedge-fund/pyproject.toml ai-hedge-fund/poetry.lock* /app/ai-hedge-fund/ |
| RUN python3 -m venv /opt/venv-hedge \ |
| && /opt/venv-hedge/bin/pip install --no-cache-dir -U pip "poetry==1.8.5" \ |
| && cd /app/ai-hedge-fund \ |
| && /opt/venv-hedge/bin/poetry config virtualenvs.create false \ |
| && VIRTUAL_ENV=/opt/venv-hedge /opt/venv-hedge/bin/poetry install \ |
| --no-root --without dev --no-interaction --no-ansi |
| COPY ai-hedge-fund/ /app/ai-hedge-fund/ |
|
|
| |
| COPY dexter/ /app/dexter/ |
| ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 |
| RUN cd /app/dexter && bun install |
|
|
| |
| COPY --from=frontend /fe/dist /app/web |
|
|
| |
| COPY supervisord.conf /etc/supervisord.conf |
| COPY entrypoint.sh /usr/local/bin/entrypoint.sh |
| COPY state-backup.sh /usr/local/bin/state-backup.sh |
| RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/state-backup.sh \ |
| && mkdir -p /home/user/.openbb_platform /data /app/dexter/.dexter \ |
| && chown -R user:user /home/user /data /app/dexter /app/ai-hedge-fund /app/web |
|
|
| USER user |
| ENV OPENBB_API_BASE_URL=http://127.0.0.1:6900 \ |
| DEXTER_AGENT_URL=http://127.0.0.1:7778 \ |
| DEXTER_SERVER_PORT=7778 \ |
| LIGHTPANDA_CDP_URL=ws://127.0.0.1:9222 \ |
| WEB_DIR=/app/web \ |
| PYTHONUNBUFFERED=1 \ |
| STATE_REPO=JsonLord/hedge-state |
|
|
| EXPOSE 7860 |
| CMD ["/usr/local/bin/entrypoint.sh"] |
|
|