FROM python:3.14.2
RUN apt-get update && apt-get install -yq socat
COPY --chmod=444 flag.txt .
RUN mv flag.txt /flag-$(md5sum flag.txt | cut -c-32).txt

USER nobody:nogroup
WORKDIR /home/nobody
RUN mkdir notes && cd notes && \ 
    git init && git config user.email "nobody@example.com" && git config user.name "nobody" && git commit --allow-empty -m "Initial commit"
COPY --chmod=444 chal.py .


CMD ["socat", "TCP-L:5000,fork,reuseaddr", "EXEC:'python chal.py',stderr"]
