fitness-web/Dockerfile
Jacob Hinkle 5584022a23 Single-container AI coach with agent API endpoints and UI polish
- Merge opencode-serve into the web container via entrypoint script
- Add /api/agent/* JSON endpoints for workouts, sets, checkins
- Rewrite fitness-trainer.md to use API instead of markdown files
- Pass recent workouts and check-ins as chat context to the coach
- Show current training phase on dashboard
- Clarify check-ins as morning check-ins (calories/steps = yesterday)
- Add NixOS deployment section to README
- Make all check-in fields explicitly optional in UI
2026-06-29 10:50:01 -04:00

21 lines
870 B
Docker

FROM node:22-alpine AS opencode-build
RUN apk add --no-cache curl && \
curl -fsSL https://opencode.ai/install | sh
FROM python:3.12-slim
RUN apt-get update && apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir uv
WORKDIR /app
COPY requirements.txt .
RUN uv pip install --system --no-cache-dir -r requirements.txt
COPY --from=opencode-build /usr/local/bin/opencode /usr/local/bin/opencode
COPY . .
EXPOSE 8000
ENV OPENCODE_SERVE_URL=http://127.0.0.1:4096
ENV AGENT_API_KEY=dev-agent-key-change-in-production
RUN mkdir -p /root/.config && \
ln -s /app/opencode /root/.config/opencode && \
printf '#!/bin/sh\nopencode serve --host 127.0.0.1 --port 4096 &\nsleep 1\nexec uvicorn app.main:app --host 0.0.0.0 --port 8000\n' > /entrypoint.sh && chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]