000x's picture
Upload 6 files
33d5d60 verified
Raw History Blame Contribute Delete
845 Bytes
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"]