Skip to content

feat: Alpine#23

Open
the-bokya wants to merge 7 commits into
frappe:mainfrom
the-bokya:alpine-support
Open

feat: Alpine#23
the-bokya wants to merge 7 commits into
frappe:mainfrom
the-bokya:alpine-support

Conversation

@the-bokya

Copy link
Copy Markdown

No description provided.

@the-bokya the-bokya changed the base branch from prod-setup to main June 7, 2026 20:15
the-bokya and others added 7 commits June 8, 2026 12:38
… helpers

Add is_alpine(), a _privileged() wrapper (skips sudo when already root, as
on Alpine images), and service_command/service_enable_command/service_running
helpers that dispatch to rc-service/rc-update on Alpine and systemctl elsewhere.
Add ApkPackageManager with canonical->apk package aliases, and route
get_package_manager() to it on Alpine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
MariaDB: install mariadb/mariadb-client via apk, initialise the empty data
dir with mariadb-install-db and enable the service; start/stop via
service_command (rc-service on Alpine, systemctl elsewhere).
Node.js: install nodejs/npm via apk on Alpine instead of the nodesource apt repo.
nginx: default config dir to /etc/nginx/http.d on Alpine, start/enable the
service on first reload, and use _privileged for symlink + nginx -t so it works
as root without sudo.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add OpenRCProcessManager, which renders one supervise-daemon init script per
bench process into config/openrc/, symlinks them into /etc/init.d/, and enables
them in the default runlevel. Add a shared ProcessManager._split_command helper
to map Procfile entries onto init-script env/directory/command fields.

Wire 'openrc' through ProductionConfig, the ProcessManagerFactory (create +
detect_running), and the init / setup production dispatch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bench init installs the full musl build header set (linux-headers, libffi-dev,
openssl-dev, libxml2/xslt, image libs) plus bash and tzdata so frappe's wheels
compile and its runtime assumptions hold on Alpine.

install.sh is now POSIX sh (runs under Alpine's busybox ash with no bash
preinstalled), apk-installs its own base deps on Alpine, tolerates a
non-tracking clone on re-run, and writes PATH to ~/.profile for ash/sh shells.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Alpine ships /etc/nginx/http.d/default.conf with a 'listen 80/[::]:80
default_server' that returns 404 to block stray virtualhosts. It sits in the
same include dir bench uses and owns the IPv6 default_server, so it shadows the
bench site for IPv6 clients (e.g. curl localhost -> ::1). Remove it on Alpine so
the bench server block is the sole :80 listener.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bench status hardcoded a systemd/supervisor label and shelled out to
'systemctl is-active' for nginx, which errors on Alpine (no systemd). Map the
process-manager label for openrc and probe service state via
platform.service_running (rc-service on Alpine, systemctl elsewhere).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant