The charm had no ``hooks/init``, so Carbone started in its default stateless mode: no Studio, no template management, and ``CARBONE_BIND`` defaulting to ``127.0.0.1`` (unreachable behind the web-proxy). Add ``hooks/init`` to: - bind on ``0.0.0.0`` so the ``web-proxy`` can reach the service ; - serve the Studio and ``/carbone-studio.js`` (``CARBONE_STUDIO``) ; - enable stateful template management (``CARBONE_TEMPLATE_MANAGEMENT``): stable 64-bit template IDs, versioning and the ``/template`` endpoints ; - align the datastore/configstore ownership on the unprivileged ``carbone`` image user, otherwise the container crash-loops with ``EACCES`` on ``/app/config/config.json``. Persist ``/app/config`` as a ``config-resources`` and set a ``docker-compose.stop_grace_period`` of 200s: Carbone flushes its template metadata on graceful shutdown, and Docker's 10s default would SIGKILL it and lose templates on redeploy. Flush metadata every 5 minutes to shrink the hard-crash window. Bump the image to ``full-5.15.1`` and add a local ``basic-deploy`` test. Verified locally: ``/status`` 200, ``/carbone-studio.js`` 200, ``GET /templates`` 200, template upload with versioning plus render from the stable template ID, and metadata survival across a container recreation.
36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
## From carbone/carbone-ee:full-5.15.1
|
|
docker-image: docker.0k.io/carbone-ee:5.15.1
|
|
docker-compose:
|
|
## Carbone flushes its template metadata to disk on graceful shutdown.
|
|
## Docker's default 10s stop timeout is shorter than Carbone's shutdown
|
|
## sequence (exitQuietPeriod + flush), so a plain redeploy would SIGKILL
|
|
## it and lose the templates/versioning. Keep this above Carbone's
|
|
## exitDeadline (default 3 min).
|
|
stop_grace_period: 200s
|
|
data-resources:
|
|
## Templates and the template-management metadata store (metadata.db)
|
|
## both live here, so they survive redeploys and are covered by backup.
|
|
- /app/template
|
|
config-resources:
|
|
## Holds the optional Enterprise license (*.carbone-license) and the
|
|
## authentication public key (key.pub). See README.org.
|
|
- /app/config
|
|
|
|
uses:
|
|
web-proxy:
|
|
#constraint: required | recommended | optional
|
|
#auto: pair | summon | none ## default: pair
|
|
constraint: recommended
|
|
auto: pair
|
|
solves:
|
|
proxy: "Public access"
|
|
default-options:
|
|
target: !var-expand ${MASTER_BASE_SERVICE_NAME}:4000
|
|
|
|
backup:
|
|
constraint: recommended
|
|
auto: pair
|
|
solves:
|
|
backup: "Automatic regular backup"
|
|
default-options:
|