2026-07-02 01:36:30 -07:00
|
|
|
# syntax=docker/dockerfile:1.7
|
|
|
|
|
# Hanzo Help Center — Frappe Helpdesk on Base/SQLite.
|
|
|
|
|
#
|
|
|
|
|
# Proves the "one Frappe-core -> all Frappe apps" thesis: the SAME recipe
|
|
|
|
|
# (bench + hanzoai/frappe SQLite driver) is reused across every Frappe app;
|
|
|
|
|
# only the app layer (helpdesk) swaps. Second Frappe app after hanzoai/erp.
|
|
|
|
|
#
|
|
|
|
|
# Data model: org == tenant. One SQLite site per org, persisted on the
|
|
|
|
|
# mounted volume (Hanzo Base/SQLite). No MariaDB, no Postgres, no external DB.
|
|
|
|
|
# Built on-cluster via arcd/BuildKit (never GitHub builders, never locally).
|
|
|
|
|
|
|
|
|
|
ARG PYTHON_VERSION=3.14
|
|
|
|
|
FROM python:${PYTHON_VERSION}-slim-trixie AS build
|
|
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
|
PIP_NO_CACHE_DIR=1 \
|
2026-07-02 01:57:17 -07:00
|
|
|
NODE_MAJOR=24 \
|
2026-07-02 01:36:30 -07:00
|
|
|
BENCH_DIR=/home/frappe/frappe-bench \
|
|
|
|
|
PATH=/home/frappe/.local/bin:$PATH
|
|
|
|
|
|
|
|
|
|
# Frappe system dependencies. SQLite is stdlib in CPython, so no DB client.
|
|
|
|
|
# wkhtmltopdf for PDF/print, redis-server for cache/queue/socketio (in-pod),
|
|
|
|
|
# node for the frappe-ui / helpdesk SPA asset build.
|
2026-07-02 01:39:36 -07:00
|
|
|
ARG WKHTMLTOX_DEB=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb
|
2026-07-02 01:36:30 -07:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
2026-07-02 01:39:36 -07:00
|
|
|
git curl wget ca-certificates build-essential pkg-config \
|
2026-07-02 02:00:08 -07:00
|
|
|
cron \
|
2026-07-02 01:36:30 -07:00
|
|
|
redis-server \
|
|
|
|
|
libffi-dev libssl-dev \
|
2026-07-02 01:53:23 -07:00
|
|
|
# C-extension build headers for frappe's pinned deps (mysqlclient, psycopg2,
|
|
|
|
|
# python-ldap, lxml, pillow) — compiled from source on Python 3.14.
|
|
|
|
|
default-libmysqlclient-dev libpq-dev libldap2-dev libsasl2-dev \
|
|
|
|
|
libxml2-dev libxslt1-dev libjpeg-dev zlib1g-dev libcups2-dev \
|
2026-07-02 01:39:36 -07:00
|
|
|
fontconfig libjpeg62-turbo libxrender1 libxext6 xfonts-75dpi xfonts-base \
|
|
|
|
|
fonts-cantarell \
|
2026-07-02 01:36:30 -07:00
|
|
|
gettext \
|
2026-07-02 01:39:36 -07:00
|
|
|
# wkhtmltopdf (patched-Qt static build; the apt package was dropped in trixie)
|
|
|
|
|
&& wget -q -O /tmp/wkhtmltox.deb "${WKHTMLTOX_DEB}" \
|
|
|
|
|
&& apt-get install -y --no-install-recommends /tmp/wkhtmltox.deb \
|
|
|
|
|
&& rm -f /tmp/wkhtmltox.deb \
|
2026-07-02 01:36:30 -07:00
|
|
|
&& curl -fsSL https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash - \
|
|
|
|
|
&& apt-get install -y --no-install-recommends nodejs \
|
|
|
|
|
&& npm install -g yarn \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
RUN useradd -ms /bin/bash frappe
|
|
|
|
|
USER frappe
|
|
|
|
|
WORKDIR /home/frappe
|
|
|
|
|
|
|
|
|
|
# frappe-bench CLI
|
|
|
|
|
RUN pip install --user frappe-bench
|
|
|
|
|
|
|
|
|
|
# Initialise a bench against the Hanzo Frappe core (carries the SQLite driver).
|
|
|
|
|
ARG FRAPPE_REPO=https://github.com/hanzoai/frappe
|
|
|
|
|
ARG FRAPPE_BRANCH=develop
|
|
|
|
|
RUN bench init --skip-redis-config-generation --verbose \
|
|
|
|
|
--frappe-path ${FRAPPE_REPO} --frappe-branch ${FRAPPE_BRANCH} \
|
|
|
|
|
frappe-bench
|
|
|
|
|
|
|
|
|
|
WORKDIR ${BENCH_DIR}
|
|
|
|
|
|
|
|
|
|
# telephony is a hard frappe-dependency of helpdesk (pyproject).
|
|
|
|
|
RUN bench get-app --skip-assets https://github.com/frappe/telephony
|
|
|
|
|
|
2026-07-02 02:03:37 -07:00
|
|
|
# helpdesk itself, from the hanzoai/helpdesk fork (this repo). bench get-app
|
|
|
|
|
# wants a git remote (local-path parsing is broken in this bench), so pin the
|
|
|
|
|
# branch being built.
|
|
|
|
|
ARG HELPDESK_REPO=https://github.com/hanzoai/helpdesk
|
2026-07-02 03:25:15 -07:00
|
|
|
ARG HELPDESK_BRANCH=develop
|
2026-07-02 02:03:37 -07:00
|
|
|
RUN bench get-app helpdesk ${HELPDESK_REPO} --branch ${HELPDESK_BRANCH}
|
2026-07-02 01:36:30 -07:00
|
|
|
|
|
|
|
|
# Build all frontend assets (frappe desk + helpdesk SPA).
|
|
|
|
|
RUN bench build --production
|
|
|
|
|
|
|
|
|
|
# Assets are CODE, not data: snapshot the built sites/ tree (apps.txt +
|
|
|
|
|
# assets symlink targets + default configs) so the entrypoint can restore
|
|
|
|
|
# them on top of the persistent (data-only) volume at every boot.
|
|
|
|
|
RUN cp -a ${BENCH_DIR}/sites /home/frappe/sites-template
|
|
|
|
|
|
|
|
|
|
COPY --chown=frappe:frappe deploy/entrypoint.sh /home/frappe/entrypoint.sh
|
|
|
|
|
RUN chmod +x /home/frappe/entrypoint.sh
|
|
|
|
|
|
|
|
|
|
EXPOSE 8000 9000
|
|
|
|
|
ENTRYPOINT ["/home/frappe/entrypoint.sh"]
|