FROM harbor.reymota.es/sistema/python:3.14.3-alpine3.23

# install nginx y otras cosas
RUN apk add nginx netcat-openbsd curl vim jq rsync pango pango-dev cairo postgresql-client bash glib fontconfig font-noto

COPY ./src/requirements.txt requirements.txt
RUN python3 -m pip install --upgrade pip
RUN pip install --user --no-cache-dir -r requirements.txt

COPY ./nginx/default.conf /etc/nginx/http.d/nginx.conf
COPY ./src/config/FIDO_Passkey_mark_A_black.jpg /root/.local/lib/python3.14/site-packages/passkeys/static/passkeys/imgs/

# link nginx logs to container stdout
RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
    ln -sf /dev/stderr /var/log/nginx/error.log && \
    chgrp -R 0 /var/lib/nginx && \
    chmod -R g=u /var/lib/nginx

ENV PATH="/root/.local/bin:$PATH"

# copy the django code
COPY ./src ./app

RUN chgrp -R 0 ./app && \
    chmod -R g=u ./app

# change our working directory to the django projcet roo
WORKDIR /app

# execute our entrypoint.sh file
CMD ["/app/config/entrypoint.sh"]
