File size: 935 Bytes
466436b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:20-slim

# Set noninteractive installation
ENV DEBIAN_FRONTEND=noninteractive

# Install build dependencies
RUN apt-get update && apt-get install -y \
    curl \
    git \
    && rm -rf /var/lib/apt/lists/*

# Create app directory
WORKDIR /app

# Copy entire trigo-web project
COPY trigo-web/ ./

# Install all dependencies (root, app, backend)
RUN npm install && \
    cd app && npm install && \
    cd ../backend && npm install && \
    cd ..

# Build jison parsers (required for the game)
RUN npm run build:parsers

# Build frontend (generates dist folder)
RUN cd app && npm run build

# Build backend TypeScript
RUN cd backend && npm run build

# Set environment variables for Hugging Face Spaces
ENV PORT=7860
ENV HOST=0.0.0.0
ENV NODE_ENV=production

# Expose port 7860 (required by Hugging Face Spaces)
EXPOSE 7860

# Start backend server (which will also serve frontend static files)
CMD ["npm", "run", "start:prod"]