File size: 946 Bytes
c9af408
 
45ab2bd
c9af408
45ab2bd
c9af408
 
 
45ab2bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9af408
 
45ab2bd
 
 
c9af408
45ab2bd
 
c9af408
 
45ab2bd
c9af408
45ab2bd
 
 
c9af408
 
45ab2bd
c9af408
 
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
# Frontend-only deployment for Hugging Face Spaces
# This is the recommended approach for quick deployment

FROM node:18-alpine AS builder

WORKDIR /app

# Copy frontend files
COPY frontend/package*.json ./

# Install dependencies
RUN npm install --prefer-offline --no-audit

# Copy source code
COPY frontend/src ./src
COPY frontend/index.html .
COPY frontend/vite.config.ts .
COPY frontend/tsconfig.json .
COPY frontend/tsconfig.node.json .

# Build for production
RUN npm run build

# Runtime stage
FROM node:18-alpine

WORKDIR /app

# Install serve for production
RUN npm install -g serve

# Copy built application
COPY --from=builder /app/dist ./dist

# Expose port (Hugging Face spaces use port 7860)
EXPOSE 7860

# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
    CMD wget --quiet --tries=1 --spider http://localhost:7860 || exit 1

# Start the application
CMD ["serve", "-s", "dist", "-l", "7860"]