Try ERPNext Buy Support Partners Foundation

How to Auto-start ERPNext on Boot in Docker

One thing I like in ERPNext production mode is that ERPNext automatically starts up on boot and shuts down on Linux shutdown.

How can we do this in docker?

Did you try dockers manual ?
Normally i use --restart= when making any container with important services

You can check dockers restart policies here

Good luck.

I think restart here refers to processes that may die while the server is on.

In my case, the server gets shutdown and booted up every day.

In production mode, ERPNext server starts up automatically.
In docker you have to issue some command line commands to start it.
Can docker have this auto-startup of ERPNext?

It should work even after reboot

docker-compose : https://docs.docker.com/compose/compose-file/#restart
docker swarm : https://docs.docker.com/compose/compose-file/#restart_policy

2 Likes

It may be good to add this restart policy instruction to the ERPNext docker readme instructions

Does docker gracefully close when the server receives a shutdown signal?

docker stop tries to gracefully close containers for 10 sec. I didn’t know this, I checked docker documentation. Docker has a vast community and documentation to refer. I think when systemctl stops docker, docker stops containers. I’ve not used docker on a host which reboots everyday.

1 Like