Add Docker deployment, remove Clerk auth, and configure OSS mode
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ __pycache__
|
||||
.pytest_cache
|
||||
.mypy_cache
|
||||
data/
|
||||
frontend/
|
||||
#frontend/
|
||||
.git/
|
||||
.claude/settings.*
|
||||
.claude/plans/
|
||||
|
||||
@@ -269,7 +269,7 @@ class AnthropicProvider(LLMProvider):
|
||||
runs ``validate.py`` server-side via code_execution, and voluntarily
|
||||
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
|
||||
user_content: list[dict] = []
|
||||
@@ -278,13 +278,15 @@ class AnthropicProvider(LLMProvider):
|
||||
user_content.append({"type": "text", "text": user_text})
|
||||
|
||||
messages: list[dict] = [{"role": "user", "content": user_content}]
|
||||
container: dict = {
|
||||
"skills": [{
|
||||
"type": "custom",
|
||||
"skill_id": skill_id,
|
||||
"version": version,
|
||||
}],
|
||||
}
|
||||
container: dict | None = None
|
||||
if skill_id:
|
||||
container = {
|
||||
"skills": [{
|
||||
"type": "custom",
|
||||
"skill_id": skill_id,
|
||||
"version": version,
|
||||
}],
|
||||
}
|
||||
|
||||
total_input = 0
|
||||
total_output = 0
|
||||
|
||||
@@ -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
|
||||
@@ -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"]
|
||||
@@ -36,9 +36,7 @@ const nextConfig: NextConfig = {
|
||||
"img-src 'self' data: https: blob:",
|
||||
"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" +
|
||||
extra(CSP_CONNECT_HOSTS) +
|
||||
" " +
|
||||
(process.env.NEXT_PUBLIC_API_URL?.trim() || "http://localhost:8000"),
|
||||
extra(CSP_CONNECT_HOSTS),
|
||||
"frame-src 'self' https://vercel.live" + extra(CSP_FRAME_HOSTS),
|
||||
"worker-src 'self' blob:",
|
||||
].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 = {
|
||||
success: boolean;
|
||||
|
||||
@@ -26,7 +26,7 @@ export function safeMpn(mpn: string): string {
|
||||
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
|
||||
let _getToken: (() => Promise<string | null>) | null = null;
|
||||
|
||||
Reference in New Issue
Block a user