Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Mike — Docker Compose environment
# Copy to .env and fill in the values before running `docker compose up -d`

# ---- Required ----
JWT_SECRET=change-me-to-a-long-random-secret-string
POSTGRES_PASSWORD=change-me-to-a-strong-password

# ---- LLM API keys (set at least one) ----
ANTHROPIC_API_KEY=
GEMINI_API_KEY=
OPENAI_API_KEY=
# Local LLM via Ollama (leave empty to disable)
OLLAMA_BASE_URL=

# ---- Optional overrides ----
# Public URL at which the backend is reachable FROM the browser.
# Change this if you expose Mike behind a reverse proxy.
NEXT_PUBLIC_API_BASE_URL=http://localhost:3001
BACKEND_URL=http://localhost:3001
FRONTEND_URL=http://localhost:3000
BACKEND_PORT=3001
FRONTEND_PORT=3000
38 changes: 34 additions & 4 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,44 @@
PORT=3001
FRONTEND_URL=http://localhost:3000

# ---------------------------------------------------------------------------
# Auth & database
# ---------------------------------------------------------------------------
# MODE A — Supabase (default, cloud-hosted)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_SECRET_KEY=your-supabase-service-role-key

R2_ENDPOINT_URL=https://your-account-id.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID=your-r2-access-key
R2_SECRET_ACCESS_KEY=your-r2-secret-key
R2_BUCKET_NAME=mike
# MODE B — Local PostgreSQL (set AUTH_MODE=local and DATABASE_URL instead)
# AUTH_MODE=local
# DATABASE_URL=postgres://mike:secret@localhost:5432/mike
# JWT_SECRET=change-me-to-a-long-random-string
# JWT_EXPIRY_DAYS=30

# ---------------------------------------------------------------------------
# File storage
# ---------------------------------------------------------------------------
# By default files are stored locally (no external storage needed).
# LOCAL_STORAGE_PATH=./uploads
# BACKEND_URL=http://localhost:3001

# Optional: Cloudflare R2 (takes priority over local storage when configured)
# R2_ENDPOINT_URL=https://your-account-id.r2.cloudflarestorage.com
# R2_ACCESS_KEY_ID=your-r2-access-key
# R2_SECRET_ACCESS_KEY=your-r2-secret-key
# R2_BUCKET_NAME=mike

# ---------------------------------------------------------------------------
# LLM API keys
# ---------------------------------------------------------------------------
GEMINI_API_KEY=your-gemini-key
ANTHROPIC_API_KEY=your-anthropic-key
OPENROUTER_API_KEY=your-openrouter-key
RESEND_API_KEY=your-resend-key

# Local LLM via Ollama (OpenAI-compatible)
OLLAMA_BASE_URL=http://localhost:11434/v1
OLLAMA_API_KEY=

# Local LLM via llama.cpp server (OpenAI-compatible)
LLAMACPP_BASE_URL=http://localhost:8080/v1
LLAMACPP_API_KEY=
24 changes: 24 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM node:22-slim AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev

FROM node:22-slim AS build
WORKDIR /app
COPY package*.json tsconfig.json ./
RUN npm ci
COPY src ./src
RUN npm run build

FROM node:22-slim AS runtime
# libreoffice is needed for DOCX→PDF conversion
RUN apt-get update && apt-get install -y --no-install-recommends \
libreoffice \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY package.json ./
ENV NODE_ENV=production
EXPOSE 3001
CMD ["node", "dist/index.js"]
Loading