Spaces:
Sleeping
Sleeping
File size: 780 Bytes
02cf817 481feb4 6b10b20 44c9c99 6b10b20 481feb4 6b10b20 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | # Frontend Dockerfile for HF Spaces
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY web/package*.json ./
RUN npm ci
# Copy source code
COPY web/ ./
# Set build-time environment variable for API gateway URL
ARG VITE_GATEWAY_URL=https://deepthoughtai-evo-gateway.hf.space
ENV VITE_GATEWAY_URL=$VITE_GATEWAY_URL
# Increase Node.js heap to prevent OOM-kill (exit 137) during Vite/tsc build
ENV NODE_OPTIONS=--max-old-space-size=2048
# Build the app (Vite will use VITE_GATEWAY_URL)
RUN npm run build
# Production stage - serve with nginx
FROM nginx:alpine
# Copy built files
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY web/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 7860
CMD ["nginx", "-g", "daemon off;"] |