FROM frappe-crm-local:v1.87.0-de
USER root
RUN apt-get update && apt-get install -y --no-install-recommends gpg-agent && rm -rf /var/lib/apt/lists/*
USER frappe
COPY --chown=frappe:0 runtime/patch_security_dependencies.py /tmp/giver_crm_security.py
RUN env/bin/python /tmp/giver_crm_security.py && \
    env/bin/pip install --no-deps -e apps/frappe && \
    env/bin/pip install 'PyJWT==2.15.0' 'pypdf==6.19.0' 'Werkzeug==3.1.9' 'WeasyPrint==70.0'
COPY --chown=frappe:0 app /opt/giver_crm
COPY --chown=frappe:0 runtime /opt/giver_crm_runtime
RUN env/bin/pip install --no-deps -e /opt/giver_crm && \
    ln -s /opt/giver_crm apps/giver_crm && \
    ln -s /opt/giver_crm/giver_crm/public /home/frappe/frappe-bench/assets/giver_crm && \
    env/bin/pip check
