Above command updates the apps.txt with apps from image.
apps.json has git details about apps. In container images apps are not git repos. .git dir is removed
For updating static assets do not specify assets under volumes in your compose.yaml, refer pwd.yml
Stop containers
Remove stopped containers
remove hash / unnamed docker volume (docker volume ls|rm) if your sites is in bind mount on host directory then you can just do docker volume prune and itâll remove volumes not attached to containers
Restart containers with new image, itâll create new unnamed/hash volumes for new static assets.
To add or remove apps, run command to update apps.txt and bench install-app uninstall-app. Sequence:
I hadnât got the rebuild of apps.txt line in my docker-compose - I guess I must have made mine more than 4 months ago!
Will it do any harm to rerun the build container on every restart? Or do I have to take it out of the docker-compose, or put some test in it so it does nothing for an existing site?
if build is the âconfiguratorâ and âmigrationâ service ideally keep it separate so even on server restarts it doesnât trigger them. If you are okay with them running over and over again. Or you managed to script it in for when to run, then keep it in compose yaml
if build means image build service, then ideally build your image with a name and tag, it will be visible locally, execute docker images to list local images. Then you can use the image in your compose, if the {name}:{tag} exists locally itâll not complain or try to pull from remote and use the local image. This way you donât trigger builds on server restart.
I should have been more clear, sorry - I mean the containers in the pwd.yml called configurator and create-site. Will it do any harm to run them on an existing, working setup? e.g. when the server is rebooted, or the site is taken down for some reason and then restarted?
OK, so it wonât actually break anything. I will leave them in, because without them people have to know how to (and remember to) do these steps manually sometimes.
Sorry, @revant_one , Iâm still totally unclear what should be in my docker-compose file, then.
What I am looking for is a single docker-compose file that I can start up, and be sure that I will end up with a working system. It should still function if I:
Rebuild the container, to get the latest code
Restore a backup from another instance, possibly running a different version
Build from scratch with empty volumes
Start or build with existing volumes
Iâm trying to make this foolproof (and failing miserably!). Perhaps because I am an inventive fool
Safest alternative is to remove run once services from compose and run them as single task using docker run
Refer container basics for docker run command
If you use immutable image tags then once configured the system can restart without any change.
Build image should be separate. May be create a compose for it separately.
If you donât want immutable image tags, prefer use of branches instead of tags, no plan to scale bench across servers then struggle so much over native bench and it can do everything with single command bench update