I\'ve an app running on multiple Docker containers defined by docker-compose
. Everything works fine from my user and the docker-compose ps
output l
Compose will always reuse containers as long as their config hasn't changed.
If you have any state in a container, you need to put that state into a volume. Containers should be ephemeral, you should be able to destroy them and recreate them at any time without losing anything.
If you need to initialize something I would do it in the Dockerfile, so that it's preserved in the image.