FROM python:3.12-alpine

RUN apk add build-base wget && wget http://oldhome.schmorp.de/marc/data/fcrackzip-1.0.tar.gz && tar -xzf fcrackzip-1.0.tar.gz && cd fcrackzip-1.0 && ./configure && make CFLAGS="-Wno-implicit-int" && make install
RUN pip install flask

RUN adduser -D ctf
USER ctf

WORKDIR /app
COPY app.py ./
COPY flag.txt ./
COPY utils.py ./
COPY templates/ ./templates/

CMD python3 app.py
