CETAN Documentation
This documentation covers the CETAN Web Application Server, logging, TLS, authentication, IP filtering, Safe secrets, Safe utilities, development environment setup, and building C++ REST web services using the CETAN REST API.
Contents
Running the CETAN Server Inside Docker
This section describes how to run the CETAN Web Application Server inside a Docker
container using the prebuilt Docker image cetan_latest.tar.gz. Users
only need to extract the image, prepare the CETAN home directory, and start the
container with the required volume mounts.
1. Load the Docker Image
Download cetan_latest.tar.gz and extract it:
tar -xzf cetan_latest.tar.gz
Load the image into Docker:
docker load -i cetan_latest
After loading, the image cetan:latest becomes available for use.
2. Create the CETAN Home Directory
Create the directory structure under /opt/apps/cetan. This directory
serves as the CETAN home for the Docker container.
/opt/apps/cetan
├── config (cetan_config.xml, slog_config.xml)
├── ext (your .ctn web applications)
├── html (static HTML content)
├── logs (server logs)
└── security (cetan.safe, blacklist.conf, certificates)
Create the directories:
sudo mkdir -p /opt/apps/cetan/config
sudo mkdir -p /opt/apps/cetan/ext
sudo mkdir -p /opt/apps/cetan/html
sudo mkdir -p /opt/apps/cetan/logs
sudo mkdir -p /opt/apps/cetan/security
3. Set Ownership and Permissions
The CETAN server inside Docker runs as the cetan user. Assign proper
ownership and permissions to the CETAN home directory:
sudo chown -R cetan:cetan /opt/apps/cetan
sudo chmod -R 770 /opt/apps/cetan
These permissions ensure that the CETAN server can read and write its required directories while maintaining security.
4. Start the CETAN Docker Container
Run the CETAN server container with the required volume mounts:
docker run --name cetan-server --rm -it --init \
-p 443:2025 \
--mount type=bind,source=/opt/apps/cetan/security,target=/opt/apps/cetan/security \
--mount type=bind,source=/opt/apps/cetan/config,target=/opt/apps/cetan/config \
--mount type=bind,source=/opt/apps/cetan/logs,target=/opt/apps/cetan/logs \
--mount type=bind,source=/opt/apps/cetan/ext,target=/opt/apps/cetan/ext \
--mount type=bind,source=/opt/apps/cetan/html,target=/opt/apps/cetan/html \
--mount type=bind,source=/etc/ssl/certs,target=/etc/ssl/certs,readonly \
cetan:latest
The CETAN server will start using the configuration and applications provided in
the mounted directories. The server listens on port 2025 inside the
container and is exposed as HTTPS on port 443 on the host.
5. Deploying Applications
Place your compiled .ctn applications into the
/opt/apps/cetan/ext directory. Ensure that
cetan_config.xml references each application under the
<applications> section.
6. Stopping the Server
To stop the CETAN server, press Ctrl+C or run:
docker stop cetan-server
Because the container was started with --rm, it will be removed
automatically after stopping.
Summary
Running CETAN inside Docker provides a clean, isolated, and reproducible environment. By preparing the CETAN home directory and mounting it into the container, users can manage configuration, applications, logs, and security files without modifying the Docker image itself.