mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 10:59:59 +00:00
espocrm_daemon and espocrm_websocket exited 0 every six seconds while the main
container sat healthy for thirty-nine minutes, so the deploy waited out its retries
on
not converged: espocrm_daemon espocrm_websocket
espocrm_daemon.1 desired=Shutdown current=Complete
The service log shows our own gate working -- "[entrypoint] Exec: docker-websocket.sh"
-- and upstream's failing right after it. docker-*.sh call exitIfNotReady, which runs
`bin/command app-check` and exits 0 when that fails. CommandManager resolves the name
to an AppCheck class, and espocrm/espocrm carries no AppCheck.php at 10.0.6, so the
gate can never pass. isLegacy does not spare us either: it returns true only when
/var/www/html is itself a mount point, and we mount three subdirectories.
Only the broken half is replaced. applyConfigEnv stays, because the websocket service
is the only carrier of ESPOCRM_CONFIG_WEB_SOCKET_*, and those reach the shared
config.php nowhere else. Readiness is the caller's job already: --wait-ready blocks on
the marker the main container writes once its install has finished, which is a
strictly better-informed signal than app-check.
The logic lives in files/shell/sidecar_boot.sh rather than a bash -c string, following
the route this role already uses for docker-entrypoint-custom.sh and seed_config.php:
copied into the build context, COPYed and chmod'ed in the Dockerfile, addressed
through ESPOCRM_SCRIPT_SIDECAR_DOCKER. That buys shellcheck and bash -n coverage the
embedded string never had, drops one layer of quoting, and turns a missing argument
into a named error instead of a php invocation with no script.
ESPOCRM_APP_DIR replaces the second hardcoded /var/www/html in vars.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
41 lines
1.8 KiB
Docker
41 lines
1.8 KiB
Docker
ARG ESPOCRM_IMAGE
|
|
ARG ESPOCRM_VERSION
|
|
FROM ${ESPOCRM_IMAGE}:${ESPOCRM_VERSION}
|
|
|
|
ARG ESPOCRM_SCRIPT_SEED_HOST_REL
|
|
ARG ESPOCRM_SCRIPT_SEED_DOCKER
|
|
ARG ESPOCRM_SCRIPT_SIDECAR_HOST_REL
|
|
ARG ESPOCRM_SCRIPT_SIDECAR_DOCKER
|
|
ARG ESPOCRM_ENTRYPOINT_SCRIPT_HOST_REL
|
|
ARG ESPOCRM_ENTRYPOINT_SCRIPT_DOCKER
|
|
ARG ESPOCRM_ENTRYPOINT_SCRIPT_ORIGINAL
|
|
|
|
RUN cp -a /usr/src/espocrm/. /var/www/html/
|
|
|
|
# Exception: upstream v10 entrypoint hardcodes `set-password admin`, killing installs with a non-default admin name; the grep guard fails the build if the line changes.
|
|
RUN sed -i 's|bin/command set-password admin |bin/command set-password "$ESPOCRM_ADMIN_USERNAME" |' ${ESPOCRM_ENTRYPOINT_SCRIPT_ORIGINAL} \
|
|
&& grep -qF 'set-password "$ESPOCRM_ADMIN_USERNAME"' ${ESPOCRM_ENTRYPOINT_SCRIPT_ORIGINAL}
|
|
|
|
RUN sed -i 's#bin/command create-admin-user "$ESPOCRM_ADMIN_USERNAME" >/dev/null 2>&1#bin/command create-admin-user "$ESPOCRM_ADMIN_USERNAME" >/dev/null 2>\&1 || true#' ${ESPOCRM_ENTRYPOINT_SCRIPT_ORIGINAL} \
|
|
&& grep -qF 'create-admin-user "$ESPOCRM_ADMIN_USERNAME" >/dev/null 2>&1 || true' ${ESPOCRM_ENTRYPOINT_SCRIPT_ORIGINAL}
|
|
|
|
COPY ${ESPOCRM_SCRIPT_SEED_HOST_REL} ${ESPOCRM_SCRIPT_SEED_DOCKER}
|
|
RUN chmod +x ${ESPOCRM_SCRIPT_SEED_DOCKER}
|
|
|
|
COPY ${ESPOCRM_SCRIPT_SIDECAR_HOST_REL} ${ESPOCRM_SCRIPT_SIDECAR_DOCKER}
|
|
RUN chmod +x ${ESPOCRM_SCRIPT_SIDECAR_DOCKER}
|
|
|
|
COPY ${ESPOCRM_ENTRYPOINT_SCRIPT_HOST_REL} ${ESPOCRM_ENTRYPOINT_SCRIPT_DOCKER}
|
|
RUN chmod +x ${ESPOCRM_ENTRYPOINT_SCRIPT_DOCKER} \
|
|
&& ln -sf "${ESPOCRM_ENTRYPOINT_SCRIPT_DOCKER}" /entrypoint.sh
|
|
|
|
RUN { \
|
|
echo 'session.save_handler = files'; \
|
|
echo 'session.save_path = "/var/www/html/data/.sessions"'; \
|
|
echo 'session.gc_probability = 1'; \
|
|
echo 'session.gc_divisor = 100'; \
|
|
echo 'session.gc_maxlifetime = 1440'; \
|
|
} > "${PHP_INI_DIR}/conf.d/zz-espocrm-session.ini"
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|