| # ----------------------------- | |
| # Base image | |
| # ----------------------------- | |
| FROM node:18-bullseye | |
| # ----------------------------- | |
| # Install system dependencies | |
| # Required for: sharp, tesseract, pdf parsing | |
| # ----------------------------- | |
| RUN apt-get update && apt-get install -y \ | |
| tesseract-ocr \ | |
| libtesseract-dev \ | |
| libleptonica-dev \ | |
| libvips \ | |
| poppler-utils \ | |
| ghostscript \ | |
| build-essential \ | |
| python3 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ----------------------------- | |
| # Set working directory | |
| # ----------------------------- | |
| WORKDIR /app | |
| # ----------------------------- | |
| # Copy package files | |
| # ----------------------------- | |
| COPY package*.json ./ | |
| # ----------------------------- | |
| # Install dependencies | |
| # ----------------------------- | |
| RUN npm install --production | |
| # ----------------------------- | |
| # Copy rest of the source | |
| # ----------------------------- | |
| COPY . . | |
| # ----------------------------- | |
| # Create uploads directory | |
| # ----------------------------- | |
| RUN mkdir -p uploads | |
| # ----------------------------- | |
| # Hugging Face Spaces port | |
| # ----------------------------- | |
| EXPOSE 7860 | |
| # ----------------------------- | |
| # Environment variables | |
| # ----------------------------- | |
| ENV NODE_ENV=production | |
| ENV PORT=7860 | |
| # ----------------------------- | |
| # Start your app | |
| # IMPORTANT: entry file is room.js | |
| # ----------------------------- | |
| CMD ["node", "room.js"] | |