Upgrade Gitea Docker Compose


#1

Been using Gitea for about a week under docker and so far so good. One thing which wasn’t clear to me was how best to upgrade to a new tag. I understand this will vary depending on how Gitea is installed but it would be nice to see at least some basic advice either in the documentation or on the image README itself.

Here’s what I did to upgrade to the latest version, which probably wasn’t the best approach given it caused a few seconds of downtime:

docker-compose pull gitea
docker-compose down gitea
docker-compose rm gitea
docker-compose up -d gitea

Is there a preferred way to manage upgrades while minimizing (or, better yet, eliminating) downtime during the upgrade process when using docker-compose? For example, would it be wise (or even safe) to scale up a second gitea instance under a different docker process name to handle requests while performing the above tasks?

Given there could be cronjobs running when the container goes down or a write operation in progress it seems providing some guidance here and/or in the docs would be useful for mitigating future support requests.


How can i update gitea when i install by docker
How to backup, upgrade and migrate
#2

The use of tags, rather than :latest tag should be mentioned when creating a docker-compose file. Also the mention of backups should be included.


#3

Thanks for the reply. I usually like to tag a version in my compose files (e.g. :1.5) for deterministic builds but given the rapid development going on I’ve kept the latest tag as you’ve mentioned.

The one gotcha I ran into which caused me to run the above process seems more to do with heavy caching in Docker than anything and a few seconds of downtime is okay for me right now as I can throw up a maintenance page.

Any other tips on achieving zero downtime deployments are appreciated. Running a distributed DB like Maria with Galera comes to mind and possibly just scaling up multiple Gitea instances in a Swarm behind a load balancer should do the trick. We’ll see.

Loving the product!! Arc Green rules.


#4

I’ve opened an issue here to further explore the potential for zero-downtime upgrades using Docker Compose. Solving it is not a priority for me right now though any contributions here or in the linked issue are appreciated.