Something went wrong. Try again.
a digital entity named phi that roams bsky phi.zzstoatzz.io
Something went wrong. Try again.
bot Dockerfile
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172# syntax=docker/dockerfile:1.9
# --- web frontend build stage (svelte 5 + adapter-static via bun) ---FROM oven/bun:1-slim AS web-builderWORKDIR /webCOPY web/package.json web/bun.lockb ./RUN bun install --frozen-lockfileCOPY web/ ./RUN bun run build
# --- lexidraw-mcp build stage (stdio node MCP server phi draws with) ---FROM node:22-slim AS lexidraw-builderRUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/*RUN git clone https://tangled.org/zzstoatzz.io/lexidraw-mcp /lexidraw \ && git -C /lexidraw checkout 638f62bb5cedd3c65fe9552179d3970bf8daa3a1WORKDIR /lexidrawRUN npm ci && npm run build && npm prune --omit=dev
# --- python deps stage ---FROM python:3.12-slim AS builder
# Install uv and git (needed for git+ dependencies)COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uvRUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*
# Configure uv to use /app as the project environmentENV UV_LINK_MODE=copy \ UV_COMPILE_BYTECODE=1 \ UV_PYTHON_DOWNLOADS=never \ UV_PYTHON=python3.12 \ UV_PROJECT_ENVIRONMENT=/app
# hatch-vcs needs git — pretend a version insteadENV SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0
WORKDIR /src
# Copy source for installationCOPY pyproject.toml uv.lock README.md ./COPY src/ ./src/
# Install dependencies and the application (non-editable)RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen --no-dev --no-editable
# --- runtime stage ---FROM python:3.12-slim
# node runtime for the lexidraw stdio MCP server; the copied binary needs# libstdc++ which python-slim doesn't guaranteeRUN apt-get update && apt-get install -y --no-install-recommends libstdc++6 && rm -rf /var/lib/apt/lists/*COPY --from=node:22-slim /usr/local/bin/node /usr/local/bin/nodeCOPY --from=lexidraw-builder /lexidraw/dist /opt/lexidraw/distCOPY --from=lexidraw-builder /lexidraw/node_modules /opt/lexidraw/node_modulesCOPY --from=lexidraw-builder /lexidraw/package.json /opt/lexidraw/package.json
COPY --from=builder /app /app
# Copy runtime dataCOPY personalities/ /app/personalities/COPY skills/ /app/skills/
# Copy built frontendCOPY --from=web-builder /web/build /app/web
ENV PATH="/app/bin:$PATH"ENV PYTHONUNBUFFERED=1WORKDIR /app
EXPOSE 8080CMD ["python", "-m", "uvicorn", "bot.main:app", "--host", "0.0.0.0", "--port", "8080"]