File size: 845 Bytes
33d5d60
c07206d
33d5d60
 
 
 
 
 
 
 
78c8669
 
33d5d60
 
 
78c8669
33d5d60
 
 
09dc30c
33d5d60
78c8669
33d5d60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM node:20-bookworm-slim

# Fonts so server-side text watermarks match the browser (Sinhala included)
RUN apt-get update && apt-get install -y --no-install-recommends \
      fonts-liberation fonts-dejavu-core fonts-noto-core fontconfig curl ca-certificates \
 && mkdir -p /usr/local/share/fonts/extra \
 && (curl -fsSL "https://github.com/google/fonts/raw/main/ofl/hankengrotesk/HankenGrotesk%5Bwght%5D.ttf" \
      -o /usr/local/share/fonts/extra/HankenGrotesk.ttf || echo "Hanken Grotesk skipped") \
 && fc-cache -f \
 && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY package.json ./
RUN npm install --omit=dev && npm cache clean --force
COPY . .

# Hugging Face runs Spaces as uid 1000 (the "node" user)
RUN mkdir -p /tmp/mr && chown -R node:node /tmp/mr
USER node

ENV PORT=7860 NODE_ENV=production
EXPOSE 7860
CMD ["node", "server.js"]