Take control of your document generation security and privacy by utilizing Carbone On-premise on your own infrastructure. Our On-premise solution mirrors the powerful Carbone Cloud API, offering a host of exclusive advantages:
Pricing for Carbone On-premise is customized based on your company's income and subsidiaries. Licenses are specific to each project or product, ensuring tailored value.
For detailed pricing information or to request a free trial license, contact sales on the chat or by email: contact@carbone.io.
Carbone On-Premise works the same way as Carbone Cloud API,
To generate a document, you have to:
POST /template
to get a template ID
. The template is stored in your file system into the directory template
. It is possible to store templates into a custom storage system (s3, object storage)POST /render/:templateId
from the template ID
and a JSON data-set
, then the request returns a unique usable render ID
.GET /render/:renderId
thanks to the render ID
.POST /template
=> Return a unique templateId
.POST /render/:templateId
=> Return a unique renderId
GET /render/:renderId
GET /template/:templateId
DELETE /template/:templateId
GET /status
SDKs are available to integrate the Carbone Cloud API into your service/application in a few lines of code:
To test the Cloud API in a few minutes, load a pre-made API specification into:
Learn more on the Cloud API specification, all API endpoint are details to create your HTTP client on your own language.
Carbone On-premise can be installed in different ways:
chmod +x carbone-ee
in order to execute the binary.CARBONE_EE_LICENSE
with the license key as the value--license
followed by the license key as the value when you start the server (step 5) ./carbone webserver --port 4000 --workdir .
The Carbone server is listening on http://localhost:4000
.
To change Carbone server configuration, set options.
If an error appears during the start up, you must verify:
Carbone On-Premise contains automatic installation scripts to daemonize with systemd. It has been carefully configured to provide a high level of security. The Systemd installation is working only for Ubuntu or Debian.
# Generate installation scripts
./carbone install
# Execute installation scripts and follow instructions
sudo ./install.sh
The Carbone server is listening on http://localhost:4000
.
To change Carbone server configuration, set options.
The service is configured to run with "carbone" user (automatically created) in the "/var/www/carbone-ee" directory.
It is possible to overwrite values through environment variables CARBONE_USER
and CARBONE_WORKDIR
.
You must install LibreOffice to generate PDF documents, read instructions.
A pre-built image of Carbone is available on Docker Hub.
On your terminal, start a Carbone container with the following command line.
$ export CARBONE_EE_LICENSE=`MY_CARBONE_LICENSE`
$ docker run --platform linux/amd64 -p 4000:4000 -e LANG=C.UTF-8 -e CARBONE_EE_LICENSE carbone/carbone-ee
## add the flag "-d" to run it as a background process
Two Carbone images are available for each version:
The Carbone server is listening on http://localhost:4000
.
To change Carbone server configuration, add environment variables.
To persist templates and generated documents, you must create two volumes.
A pre-built image of Carbone is available on Docker Hub.
Example of docker-compose.yml
to run a Carbone container and pass the license as environment variable CARBONE_EE_LICENSE
:
version: "3.9"
services:
carbone:
image: carbone/carbone-ee:latest
platform: linux/amd64
ports:
- "4000:4000"
environment:
- CARBONE_EE_STUDIO=true
- CARBONE_EE_LICENSE="my_onpremise_license"
- LANG=C.UTF-8
Example of docker-compose.yml
to run a Carbone container and pass the license as local file my_license.carbone-license
:
version: "3.9"
services:
carbone:
image: carbone/carbone-ee:latest
platform: linux/amd64
ports:
- "4000:4000"
secrets:
- secret.carbone-license
environment:
- CARBONE_EE_STUDIO=true
- CARBONE_EE_LICENSEDIR=/run/secrets/
- LANG=C.UTF-8
secrets:
secret.carbone-license:
file: my_license.carbone-license
The Carbone server is listening on http://localhost:4000
.
To change Carbone server configuration, add environment variables.
To persist templates and generated documents, you must create two volumes.
Contact the support if you want to build your own image of Carbone, we will provide you the Dockerfile
.
Build the image with the command:
$ docker build --platform "linux/amd64" -t carbone-ee:latest .
Then start the container:
$ docker container run --name carbone-ee -p 4000:4000 --platform linux/amd64 --volume=/var/tmp/key:/key --env CARBONE_EE_LICENSEDIR=/key --entrypoint ./carbone-ee-linux carbone-ee:latest webserver
## add the flag "-d" to run it as a background process
The server is listening by default on http://localhost:4000
.
To change Carbone server configuration, add environment variables through the Docker command.
Stop the container:
$ docker stop carbone-ee
Remove the container:
$ docker container rm carbone-ee
Contact the support if you want to build your own image of Carbone, we will provide you the Dockerfile
.
Open a terminal where the Dockerfile
and the docker-compose.yml
are located.
Start the server with the command:
$ docker-compose up
## For background mode, add the -d option
The server is listening by default on http://localhost:4000
.
To change Carbone server configuration, add environment variables into the Docker-compose.yml.
Command to stop the container without removing it:
$ docker-compose stop
Command to stop the container and removes the container, networks, volumes, and images created by up:
$ docker-compose down
Discover more Docker commands by reading the docker-compose CLI overview.
Carbone uses efficiently LibreOffice to convert documents. Among all tested solutions, it is the most reliable and stable one in production for now. Behind the scene, Carbone server does:
Installing Carbone On-premise with docker doesn't need LibreOffice to be installed, it is already included on the Docker image.
Install for:
# remove all old version of LibreOffice
sudo apt remove --purge libreoffice*
sudo apt autoremove --purge
# Download LibreOffice debian package. Select the right one (64-bit or 32-bit) for your OS.
# Get the latest from http://download.documentfoundation.org/libreoffice/stable
# or download the version currently "carbone-tested":
wget https://downloadarchive.documentfoundation.org/libreoffice/old/7.4.1.1/deb/x86_64/LibreOffice_7.4.1.1_Linux_x86-64_deb.tar.gz
# Install required dependencies on ubuntu server for LibreOffice 7.0+
sudo apt update
sudo apt install libxinerama1 libfontconfig1 libdbus-glib-1-2 libcairo2 libcups2 libglu1-mesa libsm6 libnss3
# Uncompress package
tar -zxvf LibreOffice_7.4.1.1_Linux_x86-64_deb.tar.gz
cd LibreOffice_7.4.1.1_Linux_x86-64_deb/DEBS
# Install LibreOffice
sudo dpkg -i *.deb
# If you want to use Microsoft fonts in reports, you must install the fonts
# Andale Mono, Arial Black, Arial, Comic Sans MS, Courier New, Georgia, Impact,
# Times New Roman, Trebuchet, Verdana,Webdings)
sudo apt install ttf-mscorefonts-installer
# If you want to use special characters, such as chinese ideograms, you must install a font that support them
# For example:
sudo apt install fonts-wqy-zenhei
Carbone default parameters can be overwritten through:
If an option is reported in different places, CLI options are picked in priority, then environment variables in second place, and finally the configuration file.
Options | Default Values | Description | CLI options | ENV |
---|---|---|---|---|
port | 4000 | Service PORT | --port / -p | CARBONE_EE_PORT |
workdir | Actual directory | Defines the Carbone working directory to store templates, generated documents, and resources. It creates 6 directories: - template : for storing templates (cache)- render : for storing generated documents- asset : used by Carbone - config : for storing the config.json , licenses and ES512 keys for authentication- plugin : for storing custom javascript plugins |
--workdir / -w | CARBONE_EE_WORKDIR |
licenseDir | "config/" | Absolute directory path to licenses | --licenseDir / -L | CARBONE_EE_LICENSEDIR |
license | License as a string, if the option is used, licenseDir option is skipped |
--license / -l | CARBONE_EE_LICENSE | |
factories | 1 | Multithread parameter, number of LibreOffice converter | --factories / -f | CARBONE_EE_FACTORIES |
attempts | 1 | If LibreOffice fails to convert one document, attempts options set the number of re-try |
--attemps / -a | CARBONE_EE_ATTEMPTS |
authentication | false | Authentification documentation at the following link | --authentication / -A | CARBONE_EE_AUTHENTICATION |
studio | false | Web interface to preview reports. Learn more. | --studio / -s | CARBONE_EE_STUDIO |
studioUser | admin:pass | If the authentication option is enabled, the browser requests an authentication to access the web page. Credentials have to be formated, such as: [username]:[password] . |
--studioUser / -S | CARBONE_EE_STUDIOUSER |
maxDataSize | 60MB | Maximum JSON data size accepted when rendering a report, the value must be bytes. Calcul example: 100 * 1024 * 1024 = 100MB | --maxDataSize / -mds | CARBONE_EE_MAXDATASIZE |
maxTemplateSize | 20MB | The file size limit when uploading a new template through the request POST /template , the value must be bytes. Calcul example: 30 * 1024 * 1024 = 30MB |
CARBONE_EE_MAXTEMPLATESIZE | |
templatePathRetention | 0 | Template path retention in days. 0 means infinite retention. | --templatePathRetention / -r | CARBONE_EE_TEMPLATEPATHRETENTION |
lang | en | Locale language used by Carbone | --lang / -l | CARBONE_EE_EN |
timezone | Europe/Paris | Timezone for managing dates | --timezone / -t | CARBONE_EE_TIMEZONE |
currencySource | Currency source for money conversion. If empty, it depends on the locale. | --currencySource / -cs | CARBONE_EE_CURRENCYSOURCE | |
currencyTarget | Currency target for money conversion. If empty, it depends on the locale. | --currencyTarget / -ct | CARBONE_EE_CURRENCYTARGET | |
currencyRates | { EUR : 1, USD : 1.14, ... } |
Currency rates, it is based on EUR which should be equals to "1". The option can only be set on the config/config.json file. |
||
translations | {} |
Translation object loaded at startup. It can be overwritten by rendering requests. The option can only be set on the config/config.json file. |
||
converterFactoryTimeout | 60000 | Maximum conversion/socket timeout for one render (unit: ms) | CARBONE_EE_CONVERTERFACTORYTIMEOUT | |
xlsmEnabled | false | Accept xlsm export | --xlsmEnabled / -xe | CARBONE_EE_XLSMENABLED |
collectStatistics | true |
Carbone gathers anonymous usage data to enhance our understanding, monitor performance, and support users. We strongly advise keeping collectStatistics enabled to benefit from useful features and contribute to Carbone's continuous improvement. Nevertheless, you have the option to disable collectStatistics for the entire Carbone instance by settings the value false . |
CARBONE_EE_COLLECTSTATISTICS |
To list available options, run the help command, such as:
./carbone webserver --help
Here is an example of passing options to the service:
./carbone webserver --port 4001 --factories 4 --workdir /var/www/carbone --attemps 2 --authentication --studio
To use a configuration file, config.json
must be created in the config
folder. Here is an example of a configuration:
{
"port": 4001,
"bind": "127.0.0.1",
"factories": 4,
"attempts": 2,
"authentication": true,
"studio" : true,
"studioUser" : "admin:pass" // login:password if authentication is active
}
Environment variables can be used to define options, the name has to be uppercased and has to start with the prefix "CARBONE_EE_
", such as:
export CARBONE_EE_PORT=3600
export CARBONE_EE_BIND=127.0.0.1
export CARBONE_EE_FACTORIES=4
export CARBONE_EE_WORKDIR=/var/www/carbone
export CARBONE_EE_ATTEMPTS=2
export CARBONE_EE_AUTHENTICATION=true
By default, all API endpoints are reachable without authentication, and all requests are authorized.
An authentication system is available to restrict the access. When activated, all API endpoints are protected by authentication except GET /render/:renderId
and GET /status
.
Reasons why GET /render/:renderId
is not protected:
:renderId
contains the custom report name in base64, concatenated with a 22-characters-long cryptographically random numbers with unbiased tranformation. It is somehow a unique password for each rendered report. It is better than any authentication mechanism.:renderId
is ephemeral, the resource becomes inaccessible once the file is downloaded.Three solutions to enable authentication:
--authentication
"authentication" : true
CARBONE_EE_AUTHENTICATION=true
Then the header Authorization
must be passed to all requests, with a ES512
JWT token as value. To generate a token, you can:
./carbone generate-token
generates 40-years valid tokensconfig/key.pub
(ES512). Tokens must contain at least the following payload:{
"iss": "your-carbone-user",
"aud": "carbone-ee",
"exp": 2864189447
}
Carbone Studio Light is a web interface to preview reports with a JSON editor. It is a "light" version of https://studio.carbone.io without files and version management. To enable the Carbone Studio Light:
--studio
to the binary, such as: ./carbone webserver --studio
CARBONE_EE_STUDIO
to true
"studio": true
.Then visit the URL http://127.0.0.1:4000
and enjoy!
If the authentication option is enabled, the browser requests an authentication to access the web page.
Carbone On-premise gives the possibility to override functions at specific moments to add custom features, such as adding analytics, store data on a specific storage provider, custom authentication, etc... It is possible through:
requirement plugins and middlewares can be only written using NodeJS.
For a better understanding, here is the Carbone On-premise lifecycle:
Following actions can be customized:
Pre-made plugin by the Carbone team:
To create a custom plugin, it is recommended to create a independant NodeJS repository:
# Create a separate folder
mkdir carbone-on-premise
# Initialize a node repository
npm init
# Move the carbone binary inside this folder
mv /path/to/carbone/binary ./carbone-on-premise
When Carbone On-premise is executed for the first time, default folders are created automatically (explanation here). Custom plugins MUST be inserted in the plugin
folder.
To override template storage, create the file storage.js
in the plugin
folder.
It will be possible to upload your template into an Object Storage, S3 API or other storage systems.
Export a function called writeTemplate
with 5 arguments:
req
: The req object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on.res
: The res object represents the HTTP response that a server sends when it gets an HTTP requesttemplateId
: Unique template ID as a sha256 hashtemplatePathTemp
: Absolute path of the uploaded templatecallback
: callback functionAdditional file informations are available the request header:
req.headers['carbone-template-extension']
: file extension (eg: 'xml')req.headers['carbone-template-mimetype']
: file mimetype (eg: 'application/xml')req.headers['carbone-template-size']
: file size in bytesconst fs = require('fs');
const path = require('path');
const os = require('os');
function writeTemplate (req, res, templateId, templatePathTemp, callback) {
fs.rename(templatePathTemp, path.join(os.tmpdir(), 'PREFIX_' + templateId), (err) => {
if (err) {
return callback(err);
}
return callback(null);
});
}
// Export the writeTemplate function
module.exports = {
writeTemplate
}
To override template reading, the file storage.js
in the plugin
folder has to be created. The function to explort is readTemplate
which is described as follow:
function readTemplate (req, templateId, callback) {
// Read your template and return a local path for carbone
}
module.exports = {
readTemplate
}
The function must return a local path because Carbone needs to read the file from a disk.
To override template deletion, add the function deleteTemplate
in the storage.js
file in the plugin
folder and export it, for instance:
// You can access req and res.
// For example, if you store your template on amazon S3, you could delete it
function deleteTemplate (req, res, templateId, callback) {
// Delete the template and either return a local path to unlink it or just use res to return a response
return callback(null, path.join(os.tmpdir(), 'PREFIX_' + templateId));
}
module.exports = {
deleteTemplate
}
To override render writing, add the function afterRender
in the storage.js
file in the plugin
folder and export it.
function afterRender (req, res, err, reportPath, reportName, statistics, next) {
// Write or rename your render
// TemplateID available: req.params.templateId
return next(null)
}
module.exports = {
afterRender
}
For example, this function can be used to move the render on Buckets, or it is also possible to change the response object:
res.send({
success: true,
data: {
newField: reportName
}
});
The statistics
argument return an object with:
{
"renderId": "",
"template": "filename",
"user" : "if authentication enabled, the user ID is returned, it is coming from the JWT token",
"options" : "Rendering options as an object",
"jsonSize" : "size of the JSON data-set as bytes"
}
The function readRender
has to be exported in the storage.js
located in the plugin
folder.
function readRender (req, res, renderName, next) {
// Return the directly render or a local path
}
This function can be used to return directly the file using res
, it is also possible to return the new render name, or return a path from the afterRender
function.
// Return the new render name
function readRender (req, res, renderName, next) {
return next(null, 'newRenderName')
}
// OR
// Return the new path on disk
function (req, res, renderName, next) {
return next(null, renderName, '/new/path/on/disk')
}
Before render plugin can be used to add pre-rendering actions, such as adding a prefix to the rendered filename. To do this, add a function beforeRender
in the storage.js
plugin. In these functions, the req
request variable is available and options can be altered.
function beforeRender (req, res, carboneData, carboneOptions, next) {
// add a prefix to rendered filename
carboneOptions.renderPrefix = 'myPrefix';
next(null);
}
For the authentication checking, it is possible to define a new location to store public keys. The file authentication.js
has to be created in the plugin
folder. Export the function getPublicKey
described as follow:
const fs = require('fs');
const path = require('path');
/**
* @param {Object} req : Request from the request
* @param {Object} res : Response from the request
* @param {Object} payload : https://github.com/Ideolys/kitten-jwt#api-usage to see object details
* @param {Function} callback : Function to call at the end
* @return (publicKeyContent)
*/
function getPublicKey (req, res, payload, callback) {
// Read the public key on disk or somewhere else
fs.readFile(path.join(__dirname, '..', 'config', 'key.pub'), 'utf8', (err, content) => {
if (err) {
return callback(new Error('Cannot read public key ' + err.toString()));
}
// Return the public key content in the callback
return callback(content)
});
}
// Export the getPublicKey function
module.exports = {
getPublicKey
}
Middlewares can be added before or after route. It can be useful to log or get stats about requests. Add a middlewares.js
file in the plugin
folder and export two arrays:
function beforeMiddleware (req, res, next) {
console.log('I am executed before all route')
return next()
}
function afterMiddleware (req, res, next) {
console.log('I am executed after all route')
}
module.exports = {
before: [beforeMiddleware], // Middlewares in this array will be executed before routes
after: [afterMiddleware] // Middlewares in this array will be executed after routes
}
This section shares three methods to load plugins into you Docker or Kubernetes environment.
First, you must include your plugin files into one folder named plugin
, such as:
plugin/storage.js
plugin/middlewares.js
The following command mount the folder plugin
into the /app/plugin
as volume thanks to -v ./plugin:/app/plugin
.
The config
folder is also mounted into the /app/config
. The config/config.json
contains the Carbone On-premise License, and credentials used for the plugin. If you don't use the config
folder, you can omit -v ./config:/app/config
.
The Carbone server will detect and load automatically plugin/storage.js
and plugin/middlewares.js
files on start-up.
docker run --platform linux/amd64 --name carbone -p 4000:4000 -e LANG=C.UTF-8 -v ./plugin:/app/plugin -v ./config:/app/config carbone/carbone-ee
The following Docker compose file docker-compose.yml
starts a Carbone instance and mount two volumes for the plugin
and config
folders. The Carbone server will detect and load automatically storage.js
and middlewares.js
files on start-up.
version: "3.9"
services:
carbone:
image: carbone/carbone-ee:latest
platform: linux/amd64
ports:
- "4000:4000"
volumes:
- ./plugin:/app/plugin
- ./config:/app/config
environment:
- LANG=C.UTF-8
You can build your custom Carbone image, and it can load plugin
and config
folders.
Create a Dockerfile
, then write:
FROM carbone/carbone-ee:latest
USER root
ADD ./plugin /app/plugin
ADD ./config /app/config
RUN chown -R carbone:nogroup /app/config
RUN chown -R carbone:nogroup /app/plugin
USER carbone
ENTRYPOINT ./carbone-ee-linux webserver
It will add to the latest image of Carbone your plugin
and config
folders.
Build the image named carbone-custom
with the command:
$ docker build --platform "linux/amd64" -t carbone-custom .
Then start the container based on the carbone-custom
image:
docker container run --name carbone -p 4000:4000 -e LANG=C.UTF-8 --platform linux/amd64 carbone-custom
The Carbone server will detect and load automatically storage.js
and middlewares.js
files on start-up.
When the Carbone instance starts, directories are created next to the binary, and must persist:
render
: Directory to store generated documents, used by the following API endpoints: POST /render/:templateID
, and GET /render/:renderID
.template
: Directory to store templates, used by the following API endpoints: POST /template
, GET /template
, and DELETE /template
Two strategies are available to store and access files:
template
and render
folders are located into the /app
folder.POST|GET|DELETE /template
, POST /render/:templateID
, and GET /render/:renderID
. Click to learn more about plugins.Store your templates and generated document in S3 (AWS, OVHCloud, scaleway, and any S3 provider).
A pre-made plugin is available, follow the configuration on the following link:
https://github.com/carboneio/carbone-ee-plugin-s3
The following Docker compose file docker-compose.yml
starts a Carbone instance and creates two volumes for template
and render
folders:
version: "3.9"
services:
carbone:
image: carbone/carbone-ee:latest
platform: linux/amd64
ports:
- "4000:4000"
secrets:
- source: carbone-license
target: /app/config/prod.carbone-license
environment:
- CARBONE_EE_STUDIO=true
- LANG=C.UTF-8
volumes:
- ./templates:/app/template
- ./renders:/app/render
secrets:
carbone-license:
file: your_license.carbone-license
Details:
templates
, and renders
.volumes
section. The designation ./templates
corresponds to the name of the local folder and /app/template
to the name of the folder in the container. Both will be linked./app
. It is possible to change the working directory by defining the "workdir" option.Command line for starting a Carbone instance and creating 2 volumes for template
and render
folders:
$ export CARBONE_EE_LICENSE=`MY_CARBONE_LICENSE`
$ docker run --platform linux/amd64 -p 4000:4000 -e LANG=C.UTF-8 -e CARBONE_EE_LICENSE -v $(pwd)/renders:/app/render -v $(pwd)/templates:/app/template carbone/carbone-ee:latest
Details:
templates
, and renders
.docker run -v /host/path:/container/path carbone/carbone-ee:latest
Replace /host/path
with the absolute path of the directory on the host machine that you want to mount, and /container/path
with the corresponding path inside the container, either /app/template
or /app/render
. $(pwd)
stands for "print working directory." When you use $(pwd)
in a command, it gets replaced with the current working directory's absolute path./app
. It is possible to change the working directory by defining the "workdir" option.To use a custom font into a document, you must install the font on your operating system. When Carbone server is started, fonts from the OS are loaded automatically.
To install a custom font, you typically need to copy the font file(s) to a specific directory where the system can find and use them. Here are the general steps to install a custom font for each Carbone On-premise installation method:
~/.local/share/fonts/
for individual users or /usr/local/share/fonts/
for system-wide installation. You might need administrative privileges to copy files to system-wide directories. For example, you can use the cp command to copy the font file(s) to the appropriate directory:cp /path/to/font.ttf /usr/local/share/fonts/
fc-cache -f -v
This command will rebuild the font cache, making the newly installed fonts available to the system.You'll find two Carbone images per version on Dockerhub:
If you wish to use custom fonts, there are three methods to load them:
For creating a new Carbone image with custom fonts, first create Dockerfile:
FROM carbone/carbone-ee:latest-fonts
USER root
RUN mkdir /usr/share/fonts/custom_fonts
COPY ./*.ttf /usr/share/fonts/custom_fonts
RUN fc-cache -f -v
USER carbone
ENTRYPOINT ./carbone-ee-linux webserver
All the font files ending with .tff
are copied into the custom_fonts
directory.
Then is it required to rebuild the font cache with fc-cache -f -v
, making the newly installed fonts available to the system.
Build the image named carbone-custom with the command:
docker build --platform "linux/amd64" -t carbone-custom .
Then start the container based on the carbone-custom image:
docker container run --name carbone -p 4000:4000 -e LANG=C.UTF-8 --platform linux/amd64 carbone-custom
The Carbone server will detect and load automatically font files on start-up.
To load custom fonts using Docker CLI, you would typically mount a volume containing the font files into the container.
Using volumes allows you to keep the font files outside of the container and mount them into the container at runtime. This approach can be useful if you want to keep your Docker image smaller or if you need to update the fonts without rebuilding the image.
Run the Carbone Docker container with a volume: When running your container, use the -v
flag to mount a directory containing your font files into the container. For example starting the latest version of Carbone:
docker run --platform linux/amd64 --name carbone -p 4000:4000 -e LANG=C.UTF-8 -v /path/to/local/fonts:/usr/share/fonts/custom_fonts carbone/carbone-ee:latest
Replace /path/to/local/fonts
with the path to the directory containing your font files on your local machine. /usr/share/fonts/custom_fonts
is the directory inside the container where the fonts will be mounted.
The Carbone server will detect and load automatically font files on start-up. If you want to add or update fonts, you must restart the container.
To load custom fonts using Docker Compose, you would typically mount a volume containing the font files into the container.
Using volumes allows you to keep the font files outside of the container and mount them into the container at runtime. This approach can be useful if you want to keep your Docker image smaller or if you need to update the fonts without rebuilding the image.
Here is a docker-compose.yml
loading custom fonts:
version: "3.9"
services:
carbone:
image: carbone/carbone-ee:latest
platform: linux/amd64
ports:
- "4000:4000"
volumes:
- /path/to/local/fonts:/usr/share/fonts/custom_fonts
environment:
- LANG=C.UTF-8
Replace the /path/to/local/fonts
with the path to the directory containing your font files on your local machine. /usr/share/fonts/custom_fonts
is the directory inside the container where the fonts will be mounted.
Then start the container with:
docker-compose up
The Carbone server will detect and load automatically font files on start-up. If you want to add or update fonts, you must restart the container.
Here's a guide to upgrading a Carbone binary for Linux, Mac or Windows.
cp
to move the binary into the existing Carbone server foldercp ./<carbone-ee> /Path/To/Existing/Carbone/Server/.
Replace <carbone-ee>
with the name of the binary, and /Path/To/Existing/Carbone/Server/
with the path of the existing directoryhttp://localhost:4000
Upgrading a Carbone Docker image version used for production involves a few steps to ensure a smooth transition and minimal disruption to your services. Here's a guide to upgrading a Carbone Docker image version:
templates
and renders
folders are persistent: either mounted as volume, or saved into S3 with a plugin (link documentation).config/config.json
is mounted as volumedocker pull carbone/carbone-ee:<tag>
Replace <tag>
with the version/tag you want to pull.docker stop <container_name_or_id>
docker rm <container_name_or_id>
Replace docker ps
to find the IDs of running contianers).docker run -d --name <new_container_name> --platform linux/amd64 -p 4000:4000 -e LANG=C.UTF-8 -e CARBONE_EE_LICENSE carbone/carbone-ee:<tag>
Replace <new_container_name>
with the name you want to give to the new container and <tag>
with the tag of the updated Docker image.When starting the container, pass the Carbone On-premise license as environment variable, all Carbone options as environment variables, and you can optionally mount volumes for:
config/config.json
templates
and renders
(Persistence documentation).Finally, The Carbone server is listening on http://localhost:4000
Here's how you can upgrade a Carbone Docker container using Docker Compose:
version: "3.9"
services:
carbone:
image: carbone/carbone-ee:<version> # Update the image version here
# Other configurations...
Replace <version>
with the new image version you want to use. You can write latest
if you want to use the latest version.docker-compose pull
docker-compose up -d
The -d flag runs the containers in detached mode.Finally, The Carbone server is listening on http://localhost:4000
When the Carbone server receives SIGTERM signal, (what we call "SOFT STOP")
GET /status
API request returns HTTP status 503
instead of 200
. It can be used as a trigger (liveness, readiness probes) for a load balancer, reverse-proxy, or kubernetes.