AK-21/Graphite-Industrial-Intelligence
0
1# Stage 1: Build the frontend2FROM node:22-alpine AS frontend-builder3WORKDIR /app4 5# Install server dependencies so tRPC types can be resolved by the frontend6WORKDIR /app/server7COPY server/package*.json ./8RUN npm install9COPY server/ ./10 11# Now build the client12WORKDIR /app/client13COPY client/package*.json ./14RUN npm install15COPY client/ ./16# Empty VITE_API_URL so frontend uses relative paths (same host)17ENV VITE_API_URL=""18RUN npm run build19 20# Stage 2: Build the backend and serve21FROM node:22-alpine22WORKDIR /app23 24# Copy frontend build25COPY --from=frontend-builder /app/client/dist ./client/dist26 27# Setup backend28WORKDIR /app/server29COPY server/package*.json ./30RUN npm install31COPY server/ ./32 33# Expose port 7860 for Hugging Face34EXPOSE 786035 36# Start the server37CMD ["npx", "tsx", "src/index.ts"]38 