-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (47 loc) · 2.06 KB
/
Copy pathDockerfile
File metadata and controls
57 lines (47 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Multi-stage Dockerfile for the MasterMode hosted demo.
#
# Stage 1 — build the React frontend (needs Node).
# Stage 2 — Python runtime with the Python deps + the dist/ artifacts
# from stage 1. Final image runs `uvicorn lifeos.demo.server:app`.
#
# Designed for one-click deploy platforms (vibeops.tech, Fly.io, etc.)
# that auto-detect a Dockerfile. Free-tier-friendly: no torch /
# sentence-transformers, embeddings via Gemini API.
# ── Stage 1: frontend build ───────────────────────────────────────
FROM node:20-alpine AS frontend
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm ci || npm install
COPY frontend/ ./
RUN npm run build
# ── Stage 2: python runtime ───────────────────────────────────────
FROM python:3.11-slim AS runtime
# System deps: build-essential for sqlite-vec wheel compat, curl for
# health checks during platform probes.
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python deps in their own layer for cache-friendliness.
COPY pyproject.toml ./
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -e .
# Copy app code + the prebuilt frontend.
COPY lifeos ./lifeos
COPY frontend/index.html ./frontend/
COPY --from=frontend /app/frontend/dist ./frontend/dist
# Demo-mode runtime config. GOOGLE_API_KEY must be set by the platform
# at runtime — never bake it in.
ENV LIFEOS_DATA_DIR=/tmp/mm_demo \
MASTERMODE_DEMO_MODE=true \
LIFEOS_LLM_PROVIDER=gemini \
EMBEDDING_PROVIDER=gemini \
HF_HUB_DISABLE_PROGRESS_BARS=1 \
TRANSFORMERS_VERBOSITY=error \
TQDM_DISABLE=1 \
PYTHONUNBUFFERED=1
# Many platforms inject PORT; default to 8000 for local docker runs.
ENV PORT=8000
EXPOSE 8000
# Use sh -c so $PORT expands at run time (not build time).
CMD ["sh", "-c", "uvicorn lifeos.demo.server:app --host 0.0.0.0 --port ${PORT}"]