Skip to content

Instantly share code, notes, and snippets.

@vjt
Created April 21, 2026 18:50
Show Gist options
  • Select an option

  • Save vjt/709977260dcbbb887990fad597523230 to your computer and use it in GitHub Desktop.

Select an option

Save vjt/709977260dcbbb887990fad597523230 to your computer and use it in GitHub Desktop.
aisbf Dockerfile + docker compose — nexlab/aisbf v0.99.46

aisbf — Dockerfile + compose

Generated for git.nexlab.net/nexlab/aisbf (v0.99.46, Python 3.8–3.12, FastAPI/uvicorn on port 17765).

Layout

Drop Dockerfile and compose.yaml at the repo root (same dir as requirements.txt, setup.py, main.py).

Build & run

git clone https://git.nexlab.net/nexlab/aisbf.git
cd aisbf
# place Dockerfile + compose.yaml here
mkdir -p aisbf-config aisbf-data
docker compose up -d --build

Dashboard: http://localhost:17765/dashboard (admin/admin).

Notes

  • libsecp256k1-dev is pulled in at build time for bitcoinlib / web3 / eth-account crypto stack (required even if you don't use crypto payments — the packages won't install otherwise).
  • curl_cffi is optional upstream; left as-is (will fall back cleanly if wheel missing).
  • Config persists in ./aisbf-config (mounted at /root/.aisbf). If you hit FileNotFoundError: autoselect.json, drop a valid autoselect.json into ./aisbf-config/ before starting — the installer doesn't always seed it. Example template:
{
  "autoselect": {
    "nsfw": false,
    "privacy": false,
    "classify_nsfw": false,
    "classify_privacy": false,
    "classify_semantic": false,
    "model_name": "autoselect",
    "description": "Auto-selects the best rotating model based on user prompt analysis",
    "selection_model": "general",
    "fallback": "general",
    "capabilities": ["t2t", "reasoning", "multimodal"],
    "available_models": []
  }
}
  • SQLite by default (stored under /root/.local/share/aisbf./aisbf-data). For MySQL/Redis, add services to compose.yaml and point aisbf.json at them.
  • Container runs as root for simplicity; tighten with a USER step if exposing to untrusted networks.
services:
aisbf:
build:
context: .
dockerfile: Dockerfile
image: aisbf:local
container_name: aisbf
restart: unless-stopped
ports:
- "17765:17765"
volumes:
- ./aisbf-config:/root/.aisbf
- ./aisbf-data:/root/.local/share/aisbf
environment:
PYTHONUNBUFFERED: "1"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:17765/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
libsecp256k1-dev \
libssl-dev \
libffi-dev \
git \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .
RUN pip install .
RUN mkdir -p /root/.aisbf /root/.local/share/aisbf /var/log/aisbf
EXPOSE 17765
VOLUME ["/root/.aisbf", "/root/.local/share/aisbf"]
CMD ["aisbf"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment