Apama 10.7.2 | Deploying and Managing Apama Applications | Deploying Apama Applications with Docker | Using Docker Compose with Apama
 
Using Docker Compose with Apama
Docker Compose uses a configuration file to define how to build and then how to run the one or more images and containers it defines. Where you have previously used individual commands for each image and container, you can now use Docker Compose to initiate the build or running of systems of containers.
A simple sample is provided in the samples/docker/applications/Simple directory of your Apama installation. Using that sample, you can see the basic workflow for all of the samples.
When run, the docker-compose command reads a configuration file that defines what it will build and how it should behave. This configuration file is named docker-compose.yml by default. It is recommended that you read the Docker documentation for the docker-compose command to get details on what the entries in the configuration file are.
It is important to note that the correlator may read all configuration with the extension of .yaml contained in a specified directory. You must take care over the placement and naming of any files in YAML format with an extension of .yaml to avoid unexpected behavior in the correlator. The following command uses the docker-compose.yml file in the current directory to build all the images needed for the containers defined in the docker-compose.yml file and then runs them as directed.
docker-compose up -d --rm
When run in the Simple sample directory, the above command builds and then runs the sample. You can use the following command to see output from the correlator running a simple Hello world application in the container:
docker-compose logs
To stop the container, enter the following command from the Simple sample directory:
docker-compose down
For more complex examples, see Apama samples for Docker. These examples demonstrate communications between containers, persisting container data, sharing between containers, and exposing the containers as services.