jgeusebroek / docker-spotweb

A docker image running ubuntu/20.04 Linux and Spotweb
47 stars 27 forks source link

Environment variable to clear cache on start #22

Closed arjenfvellinga closed 3 years ago

arjenfvellinga commented 3 years ago

Is it possible for you to add a boolean environment variable that execute the following command on startup:

root@spotweb:/var/www/spotweb/bin# php upgrade-db.php --clear-cache -yes

jgeusebroek commented 3 years ago

I could, but would it not be easier to just run it inside the container? Since this isn't something you'd be doing regularly. docker exec spotweb /usr/bin/php /var/www/spotweb/bin/upgrade-db.php --clear-cache -yes

Also, when the image is replaced with a newer version, the cache will be cleared because of the new container.

arjenfvellinga commented 3 years ago

True, that I don't know how often I would want to execute this. I don't restart the dockers that often, so for me clearing the cache at restart would be ok. But I'm fine to make a cron job on my machine for this.

jgeusebroek commented 3 years ago

OK, great. I'm closing this issue.