FROM node:lts-slim
# Puppeteer downloads Chrome for Testing on x86-64 Linux; there is no arm64 Linux build, so use the distribution's browser.
RUN apt-get update && apt-get install -y --no-install-recommends chromium 2>&1 | grep -E "Need to get|After this operation|newly installed" ; rm -rf /var/lib/apt/lists/*
ENV PUPPETEER_SKIP_DOWNLOAD=true PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
WORKDIR /app
RUN npm i --no-audit --no-fund mammoth@1.13.0 puppeteer@25.19.0 2>&1 | tail -2 && du -sh node_modules
RUN (npm i --no-audit --no-fund docx-pdf@0.0.1 2>&1 | tail -3) ; ls node_modules/.bin | grep -i phantom || echo "no phantomjs binary"
