Add Docker deployment, remove Clerk auth, and configure OSS mode
This commit is contained in:
@@ -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