FROM node:20-slim # Install LaTeX distribution # We use texlive-xetex, biber, and texlive-lang-spanish for APA 7 and XeLaTeX support RUN apt-get update && apt-get install -y \ texlive-xetex \ texlive-bibtex-extra \ biber \ texlive-lang-spanish \ fontconfig \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install Node dependencies COPY package*.json ./ RUN npm install # Copy application source code COPY . . # Build the TypeScript MCP Server RUN npm run build # Create directory for compiling PDFs with wide permissions RUN mkdir -p temp_projects && chmod 777 temp_projects # Start the application on Cloud Port 7860 ENV PORT=7860 EXPOSE 7860 CMD ["npm", "start"]