Add Docker deployment, remove Clerk auth, and configure OSS mode

This commit is contained in:
2026-07-23 20:26:59 +00:00
parent b26ad3509f
commit 4888092364
7 changed files with 102 additions and 14 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ __pycache__
.pytest_cache .pytest_cache
.mypy_cache .mypy_cache
data/ data/
frontend/ #frontend/
.git/ .git/
.claude/settings.* .claude/settings.*
.claude/plans/ .claude/plans/
+10 -8
View File
@@ -269,7 +269,7 @@ class AnthropicProvider(LLMProvider):
runs ``validate.py`` server-side via code_execution, and voluntarily runs ``validate.py`` server-side via code_execution, and voluntarily
calls ``output_tool`` once it has well-formed data. calls ``output_tool`` once it has well-formed data.
""" """
skill_id, version = settings.get_skill(skill_name) try:\n skill_id, version = settings.get_skill(skill_name)\n except Exception:\n skill_id, version = None, None
# Build initial user content # Build initial user content
user_content: list[dict] = [] user_content: list[dict] = []
@@ -278,13 +278,15 @@ class AnthropicProvider(LLMProvider):
user_content.append({"type": "text", "text": user_text}) user_content.append({"type": "text", "text": user_text})
messages: list[dict] = [{"role": "user", "content": user_content}] messages: list[dict] = [{"role": "user", "content": user_content}]
container: dict = { container: dict | None = None
"skills": [{ if skill_id:
"type": "custom", container = {
"skill_id": skill_id, "skills": [{
"version": version, "type": "custom",
}], "skill_id": skill_id,
} "version": version,
}],
}
total_input = 0 total_input = 0
total_output = 0 total_output = 0
+49
View File
@@ -0,0 +1,49 @@
services:
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: pinscope-backend
restart: unless-stopped
env_file:
- .env
environment:
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
volumes:
- ./data:/app/data
- ./taxonomy:/app/taxonomy
ports:
- "8080:8080"
networks:
- pinscope
frontend:
build:
context: ./frontend
dockerfile: dockerfile
args:
NEXT_PUBLIC_API_URL: ""
container_name: pinscope-frontend
restart: unless-stopped
depends_on:
- backend
ports:
- "3000:3000"
networks:
- pinscope
networks:
pinscope:
driver: bridge
+39
View File
@@ -0,0 +1,39 @@
FROM node:20-alpine AS builder
WORKDIR /app
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
COPY package*.json ./
RUN npm ci
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN echo "BUILD API URL=$NEXT_PUBLIC_API_URL"
RUN npm run build
FROM node:20-alpine
WORKDIR /app
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
COPY --from=builder /app/package*.json ./
RUN npm ci --omit=dev
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/src ./src
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/next.config.ts ./next.config.ts
EXPOSE 3000
CMD ["npm","run","start"]
+1 -3
View File
@@ -36,9 +36,7 @@ const nextConfig: NextConfig = {
"img-src 'self' data: https: blob:", "img-src 'self' data: https: blob:",
"font-src 'self' data: https://vercel.live https://assets.vercel.com https://fonts.gstatic.com", "font-src 'self' data: https://vercel.live https://assets.vercel.com https://fonts.gstatic.com",
"connect-src 'self' blob: https://storage.googleapis.com https://vercel.live wss://ws-us3.pusher.com" + "connect-src 'self' blob: https://storage.googleapis.com https://vercel.live wss://ws-us3.pusher.com" +
extra(CSP_CONNECT_HOSTS) + extra(CSP_CONNECT_HOSTS),
" " +
(process.env.NEXT_PUBLIC_API_URL?.trim() || "http://localhost:8000"),
"frame-src 'self' https://vercel.live" + extra(CSP_FRAME_HOSTS), "frame-src 'self' https://vercel.live" + extra(CSP_FRAME_HOSTS),
"worker-src 'self' blob:", "worker-src 'self' blob:",
].join("; "), ].join("; "),
@@ -1,4 +1,4 @@
const BASE = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"; const BASE = process.env.NEXT_PUBLIC_API_URL || "";
export type ActionState = { export type ActionState = {
success: boolean; success: boolean;
+1 -1
View File
@@ -26,7 +26,7 @@ export function safeMpn(mpn: string): string {
return mpn.replace(/\//g, "_").replace(/:/g, "_"); return mpn.replace(/\//g, "_").replace(/:/g, "_");
} }
const BASE = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8000"; const BASE = process.env.NEXT_PUBLIC_API_URL || "";
// Auth token getter — set by useAuthApi hook // Auth token getter — set by useAuthApi hook
let _getToken: (() => Promise<string | null>) | null = null; let _getToken: (() => Promise<string | null>) | null = null;