FROM wordpress:php8.3-fpm

RUN apt update && apt install -y gcc

COPY ./challenge-custom/flag.txt /root/flag.txt
RUN chmod 400 /root/flag.txt

COPY ./challenge-custom/readflag.c /readflag.c
RUN gcc /readflag.c -o /readflag
RUN chmod +s /readflag
RUN rm /readflag.c

COPY --chown=www-data:www-data challenge-custom/custom/ /usr/src/wordpress/wp-content/plugins/custom/
