# NOTE: This hash is pinned to avoid version and environment differences.
FROM python:3.14-slim-trixie@sha256:ce40764625a4ff50df3548277632e7f96c4e77fe75fa848aae9885476e7df5a4
RUN apt-get update && apt-get install -yq cowsay socat

# cowsay is installed at `/usr/games/cowsay`
ENV PATH="/usr/games:${PATH}"

WORKDIR /app
COPY --chmod=444 jail.py .
COPY --chmod=444 flag.txt /flag.txt

USER nobody:nogroup

CMD ["socat", "-T30", "tcp-listen:1337,fork,reuseaddr", "exec:'python jail.py',stderr"]
