Is it possible to generate one docker image that will contain many applications? or at least one image that a group many images?
My situation is that in our company we have many applications that we know in fact that we will need to deploy them all in the same server, and we need to make very simple the deployment, so deploy image by image is not what we want, so, I am wondering, how can I group them? that only with one command everything should be executed?
The best practice with Docker is to use a separate container (i.e. separate image created with separate Dockerfile) for each process that is going to be running on your stack.
All of those containers get created/deployed on the same docker server, so in the end the whole stack is running in a containerized fashion on the same server.
However, if you want to add multiple applications into the same container, you can do that by adding all the commands to install, configure, start those apps into a single Dockerfile, and using Supervisor to start the applications when the container is created.
Here is a sample Dockerfile content for what I normally use:
This will start all apps defined in the Supervisor configuration files on container creation. Notice from the script above that in the same directory as the Dockerfile, you have the static directory structure of the Supervisor configuration, i.e. you have folder structure like:
./supervisord/conf.d/
Inside that conf.d folder you need the main Supervisor configuration file called supervisord.conf that contains:
In the same conf.d folder you will have 1 config file for each app you want to run, called app_name.conf.