Prerequisites
- The CA certificate is in PEM format (a text file starting with
-----BEGIN CERTIFICATE-----). - The file contains exactly one certificate.
- Use the
.crtextension for the file name inside the container.
Configuration
The PHP container does not start as root by default.update-ca-certificates requires root privileges. In your docker-compose.yml, adjust the PHP container as shown below and mount the CA certificate as a volume.
Remove any existing command on the PHP service. Startup is handled by the customized entrypoint.
The path left of the colon (
./certs/internal-ca.crt) is where the certificate is stored on the host, relative to your docker-compose.yml. Adjust it to match your environment.The path right of the colon is inside the container. The /usr/local/share/ca-certificates/ directory stays the same regardless of the host operating system.Apply
Save yourdocker-compose.yml and restart the containers:
docker compose up -d php.
How It Works
On PHP container startup, the customized entrypoint runs these steps automatically—you do not need to execute anything manually:- The CA certificate is mounted from the host to
/usr/local/share/ca-certificates/. - The container starts as root (
user: "0:0") so thatupdate-ca-certificatescan add the certificate to the system-wide trust store. /scripts/entrypoint.shswitches to the application user (PUID/PGID) and starts VARIOS AI via/scripts/run.sh.
Result
After the container starts:- The CA certificate is available inside the container.
- The certificate is registered in the system-wide trust store.
- Applications in the container can establish TLS connections to servers signed by this CA.
Typical Use Cases
- Using an internal corporate CA
- Accessing internal APIs with self-signed certificates
- Trust for private container registries or package repositories
- Outbound traffic through a firewall or proxy with TLS inspection
