Reputation: 159
I´m having troube selecting the restart policy for my Services.
My Application needs two Containers to run.
My Questions:
Does anyone have Experience with choosing the restart policy?
Do I need to have the same restart Policy for both of my services?
I would straight forward choose the on-failure policy. When something crashes in the container it should immediately startup back again.
Offical Docker Documentation: https://docs.docker.com/config/containers/start-containers-automatically/#:~:text=Restart%20policy%20details,-Keep%20the%20following&text=A%20restart%20policy%20only%20takes,going%20into%20a%20restart%20loop.
Upvotes: 1
Views: 1056
Reputation: 906
We have tried on-failure and that based on particular needs for some projects and services.
I think all depends on your needs. Have you consider what are your needs? Some questions here:
Restart policies ensure that linked containers are started in the correct order.
Docker recommends that you use restart policies, and avoid using process managers to start containers.
- on-failure[:max-retries]
- always
- unless-stopped
Upvotes: 2