# Debian 12: Debian 11 (bullseye) is past end of life and its archive no longer has the packages Chromium needs
FROM node:22-bookworm

WORKDIR /app


COPY . .

# chromium and fonts-liberation make the PDFs (company reports, verification reports). The symlink is the path VerReports.js uses.
RUN apt-get update && apt-get -y --no-install-recommends install git wget zlib1g unzip vim tini chromium fonts-liberation \
    && ln -sf /usr/bin/chromium /usr/bin/chromium-browser \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

RUN npm install --force

EXPOSE 80 443

ENTRYPOINT ["/usr/bin/tini", "--"]

RUN chmod -R 755 public/achfiles

CMD ["node","server.js"]