In my docker-compose.yaml I am saying to alway restart app service
app:
build: .
image: app:latest
ports:
- 3000:3000
restart: always
volumes:
- "./:/usr/src/app"
This works, but in case of permanent error (eg. server is running some other way, …), the service keeps trying to start. Is there way to limit number of attempts to restart the service?
Here is a demo code, which I created to take us on same page: