FROM alpine:3.23
WORKDIR /usr/app
COPY --chown=1000:1000 --chmod=400 requirements.txt ./
COPY --chown=1000:1000 --chmod=400 app.py           ./
COPY --chown=1000:1000 --chmod=400 paella.txt       ./
RUN apk add --update --no-cache        \
        python3~=3                     \
        py3-pip~=25                 && \
    pip install                        \
        --no-cache-dir                 \
        --break-system-packages        \
        -r requirements.txt         && \
    rm requirements.txt             && \
    adduser -D -H ctf
EXPOSE 4000
ENV FLAG=FCSC{flag_placeholder}
USER ctf
CMD [                                  \
    "gunicorn",                        \
    "--bind", "0.0.0.0:5000",          \
    "--keep-alive", "5",               \
    "--worker-class", "gevent",        \
    "--access-logfile",                \
    "-",                               \
    "app:app"                          \
]
