Rick
Rick

Reputation: 8846

Restart CMD process within cronjob

My docker command has the following CMD:

CMD ["npm", "start"]

Every week, my container must perform a command (preferably via cron). After the command succeeds, I must restart the process that started via CMD.

How would I restart the CMD process from within a container in docker?

Upvotes: 1

Views: 60

Answers (1)

Carlos Rafael Ramirez
Carlos Rafael Ramirez

Reputation: 6234

You can use docker exec <containername> npm restart from your cron

Regards

Upvotes: 1

Related Questions