Docker for long service servers

Hi guys, im new at docker , it seems very nice and flexible , im working with portainer for management.
There is something I dont clrearly undestand.
After reading some posts , I got the idea that docker is not good for long time production servers.
So … can someone share your experience here ?
Lets say I need a centos / ubuntu server and need to run apache on them.
I have been trying and main problem I found is that I can not run “systemctrl” nor “chkconfig” to start service on boot , so…
Are dockers good for production servers ?
How to set services(daemons) inside container to start on boot ?

btw/ Other precompiled images , like syspass,graylog , etc do start on boot … how do they do?


Welcome to docker. Here is a mess of thoughts:) A container is normally running only one thing. For example, it could run tomcat. If it needs a database then that would be in another container. You talk between containers mainly over http or shared volumes. You can run or ten tomcat servers as production in containers just fine. Note: every file that changed in a container is reverted back to the image when the container is removed. X Volumes are used to persist and share files. There are even off the self images to do that. An image is just a set of commands found in the Dockerfile. Tomcat image has a Dockerfile that you can look at. (see docker history command) Each is layer can be used in several images. Containers don’t do auto updating. You’ll have to create a new image with updated software and pull in the your data from a volume. You can have both containers up to compare.

The idea behind docker is also versatility and redundancy, so if you have multiple hosts, you can run multiple webservers using the same nfs storage, being managed by a proxy with one external ip, or round robin dns.
When one host stops working, a distributed regulatory program can start another image on another host to keep the web serviced.
Consider it a form of clustering, which could also be done at storage level (mirrored content between two storage hosts).
About the webserver: it should bevthe application that runs when the container is started, you do not run it as a daemon indirectly.