This page provides additional details and guidance regarding installing Smile CDR in a Docker container. This section can be skipped if Smile CDR is being installed as a server application.
The following steps will result in a basic deployment of Smile CDR with out-of-the-box configuration in a Docker container.
Load the image into Docker using a command similar to the following (substituting the actual name of the Docker image file provided):
docker image load --input="/path/to/smilecdr-2019.05.R01-image.tar.bz2"
Create a Docker container from the image
docker container create -p 8000:8000 -p 8001:8001 -p 9000:9000 -p 9100:9100 -p 9200:9200 -p 9201:9201 -v smilecdr_log:/home/smile/smilecdr/log -v smilecdr_db:/home/smile/smilecdr/database -v smilecdr_mq:/home/smile/smilecdr/activemq-data --name smilecdr smilecdr
The above command will create a container for Smile CDR with the following attributes:
Launch Smile CDR Docker container
docker container start smilecdr
The above command will launch Smile CDR in the Docker container. Smile CDR will run in the background.
To monitor the progress of the launch, you can view the logs using the following command:
docker container logs -f smilecdr
Alternatively, you can both build and run a Docker container using the
docker-compose command with a docker-compose.yml file. Steps are as follows:
Load the image into Docker as previously described here.
Create a file named "docker-compose.yml" containing the following:
version: "3.7" services: smilecdr: container_name: smilecdr image: smilecdr ports: - "8000:8000" - "9000:9000" - "9100:9100" - "8001:8001" - "9200:9200" - "9201:9201" volumes: - db:/home/smile/smilecdr/database - log:/home/smile/smilecdr/log - mq:/home/smile/smilecdr/activemq-data restart: unless-stopped volumes: db: mq: log:
The docker-compose.yml file above specifies the port mappings to be used between the container and the host machine and the volumes to be used to persist the database, logs, and activemq files.
Launch Smile CDR in Docker container using
Execute the following command
docker-compose -f /path/to/docker-compose.yml -p smilecdr up -d
The options above specify the location of the docker-compose.yml file (
-f), prefix to use when creating names for the volumes (
-p) and to run Smile CDR in the background (
-d). To monitor the progress of the launch, you can view the logs using the following command:
docker logs -f smilecdr
Docker supports a variety of options for creating and/or launching containers using the
docker container and
docker-compose commands. For more information about other options available, refer to the Docker Reference documentation here.
Assuming you see the phrase
Smile, we're up and running! :) in the logs, you have now started the software. To exit the logs without stopping the container, simply type
With the software started, you can try a few things (replace
localhost in the URLs below with the host name of your server if you are installing to a remote server):
admin(by default a single user with full privileges is created)
If Smile CDR fails to start or does not appear to be responsive, here are a couple things that you can check:
docker container ls. If the container is running, you should see output similar to the following:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7e401352ab80 smilecdr "/home/smile/smilecd…" 22 minutes ago Up 17 minutes 0.0.0.0:8000-8001->8000-8001/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:9100->9100/tcp, 0.0.0.0:9200-9201->9200-9201/tcp smilecdr
docker logs smilecdrto see recent console output.
docker cp smilecdr:/home/smile/smilecdr/log /path/to/local/folder/log
When you are finished with this initial test, you can stop and delete the container and volumes for database and log:
$ docker container stop smilecdr smilecdr $ docker container rm smilecdr smilecdr $ docker volume rm smilecdr_db smilecdr_log smilecdr_mq smilecdr_db smilecdr_log smilecdr_mq $
Alternatively, if you you used docker-compose to create and start your Docker container instance, than you can also use it to stop and clean up the container deployment:
docker-compose -f /path/to/docker-compose.yml -p smilecdr down -v
This command will stop the container, remove it and the three volumes.
To retrieve and review copies of the
classes/ folders deployed to the container when it is not running, you can use the
docker cp command as follows:
docker cp smilecdr:/home/smile/smilecdr/bin /path/to/copy/bin
docker cp smilecdr:/home/smile/smilecdr/classes /path/to/copy/classes
Before starting Smile CDR for the first time, there are two files you will want to examine for settings.
bin/ directory you will find a file called
setenv. This file may be used to change the amount of RAM available to Smile CDR, as well as number of other low level settings. It is a good idea to glance over it and ensure that the default settings make sense for your installation.
classes/ directory you will find a file called
cdr-config-Master.properties. This file contains all of the configuration for the modules which will be created the first time the system is started.
If changes are required to either of the configuration files above, these can be made by editing local copies of the configuration in the container and then copying the modifications back to the container using the
docker cp command:
docker cp /path/to/copy/bin/setenv smilecdr:/home/smile/smilecdr/bin
If there is a need to change the configuration files or environment settings or to add jars to the
customerlib/ directory in the Smile CDR container you can do this by creating a customized Smile CDR image based on the provided Smile CDR image and then re-creating the container using the command shown previously here.
To create a customized Smile CDR image:
Setup Docker context
When building Docker images, you need to specify a single folder or context where Docker can find all of the build dependencies. Ensure that all of your configuration changes and additions are contained within a single folder, or create a new subfolder and copy all of your changes there.
Create a Dockerfile
Create a new Dockerfile that uses the original Smile CDR image as the base image and includes instructions for any additions or updates needed for the new image. For example:
# Use base Smile CDR image as parent image FROM smilecdr # Set the smilecdr folder as working directory WORKDIR /home/smile/smilecdr # Copy modified properties file to the container. copy ./cdr-config-Master-modified.properties ./classes/cdr-config-Master.properties # Copy modified environment settings file to the container. copy ./setenv_modified ./bin/setenv # Add jar files to customerlib folder. copy ./sitelib.jar ./customerlib/sitelib.jar
Build a new Docker image
docker image build command to build a new image, for example:
docker image build -f path/to/Dockerfile --tag=smilecdr_site path/to/Docker/context
-f option above is used to specify the path and name of the Dockerfile, the
--tag option is used to specify a tag or name for the new Smile CDR image (the base image will have tag "smilecdr"). The last parameter is the location of the Docker context folder which contains all of the changes and additions that are to be copied/added to the image.
NOTE: If you need to add or change any port numbers in relation to the above changes, then you will also need to update the port mappings specified by the
-p options included with the
docker create command.
To use system environment variables for variable substitution in configuration files, you will need to set the variables in the container environment by setting
--env-file options in the
docker container create command. For details and examples of this option, see the Docker reference documentation here.
When configuring a database that requires a URL with a hostname such as PostgreSQL or MySQL, the hostname "localhost" will not be recognized by Smile CDR implementations running in a Docker container. Instead, you will need to specify one of the following:
host.docker.internalin place of "localhost".
An alternative approach is to install both Smile CDR and the database in a Docker stack. See this page for an example of how this could be done.