Skip to main content

Deployment

Dockerfile

FROM octostar/streamlit-apps-no-gpu:latest

WORKDIR /app
COPY . /app

# Build frontend + install backend dependencies
RUN bash build.sh

ENTRYPOINT ["/bin/bash", "/app/main.sh"]
EXPOSE $CODE_SERVER_PORT

The base image octostar/streamlit-apps-no-gpu:latest includes:

  • Python 3.x with the Octostar SDK pre-installed
  • System libraries for common data processing tasks

Build Script

Your build.sh should:

  1. Install Node.js (if not in base image)
  2. Install Python dependencies (pip install or uv)
  3. Build the React frontend (npm run build)
  4. Output static files to a known directory (e.g., frontend/dist/)

Runtime

main.sh typically starts FastAPI with uvicorn, serving both the API and the frontend static files:

uvicorn app.main:app --host 0.0.0.0 --port ${CODE_SERVER_PORT:-8080}

In your FastAPI app, mount the frontend build output:

from fastapi.staticfiles import StaticFiles

# API routes first
app.include_router(api_router, prefix="/api/v1")

# Then serve frontend as fallback (SPA routing)
app.mount("/", StaticFiles(directory="frontend/dist", html=True)