FROM alpine:3.23

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true

WORKDIR /usr/app
COPY ./src/package.json .
RUN apk add --update --no-cache   \
		nodejs~=24                \
		npm~=11                   \
		socat~=1                  \
		firefox~=145              \
		su-exec~=0             && \
	npm install

COPY --chown=root:root --chmod=500 ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

COPY ./src/ .

ENV FLAG=FCSC{flag_placeholder\}
CMD ["/bin/sh", "/entrypoint.sh"]
