File size: 1,118 Bytes
5c37f2e
f884d0d
 
 
 
 
5c37f2e
 
 
 
 
 
f884d0d
 
 
5c37f2e
 
 
 
 
 
 
 
 
 
 
 
58db00b
 
f884d0d
 
 
 
 
 
 
 
 
 
 
 
 
 
7eb34f8
 
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
35
36
37
38
39
40
41
42
43
44
45
# Use official Node.js LTS Alpine as base image for smaller size
FROM node:18-alpine

# Set working directory
WORKDIR /app

# Install system dependencies required for building native modules
RUN apk add --no-cache python3 make g++ git

# Install TypeScript globally to ensure tsc is available
RUN npm install -g typescript@5.0.2

# Copy package.json and package-lock.json (if exists)
COPY package*.json ./

# Install project dependencies explicitly
RUN npm install --no-save \
  react@18.2.0 \
  react-dom@18.2.0 \
  @types/react@18.2.15 \
  @types/react-dom@18.2.7 \
  typescript@5.0.2 \
  @vitejs/plugin-react@4.0.3 \
  vite@4.4.5 \
  tailwindcss@3.3.0 \
  postcss@8.4.24 \
  autoprefixer@10.4.14 \
  lucide-react@0.263.1 \
  react-markdown@9.0.1

# Copy all project files
COPY . .

# Build the application
RUN npm run build

# Expose port 3000 (Hugging Face Spaces default)
EXPOSE 3000

# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000

# Start the application with Vite preview, ensuring port 3000 and no browser auto-open
CMD ["npm", "run", "preview", "--", "--port", "3000", "--host", "0.0.0.0"]