Skip to content

Runbook (docker compose)

David Sterry edited this page Dec 3, 2022 · 9 revisions

This runbook is for Ecko installations via docker-compose.

If you run an Ecko instance via docker-compose, bookmark this page. It is meant as one place to quickly find information to rollback or mitigate an issue. It also helps ensure upgrades and migrations are done in a consistent manner.

Update docker image(s)

ssh user@host
cd mastodon            # or ecko
docker-compose pull    # get new image
docker-compose up -d   # recreate containers with new image
watch docker ps        # to ensure healthy startup within 30-60 seconds

Migrate db

docker-compose pull
docker-compose run --rm web rails db:migrate

Tootctl commands

docker-compose run --rm web bin/tootctl …

Check media usage

docker-compose run --rm web bin/tootctl media usage

Remove cached media

docker-compose run --rm web bin/tootctl media remove --days=1

Prune some remote account info

docker-compose run --rm web bin/tootctl accounts prune

Setup process with docker-compose

https://github.com/magicstone-dev/ecko/blob/main/docs/INSTALL_DOCKER_COMPOSE.md

Rollback

If after upgrading docker, you see that one or more services are restarting it's best to rollback as follows.

  1. Find the previous image you were using with docker image list. You should see one that's very recent like in the last few minutes. You want the one before that.
  2. Replace three occurences of dsterry/ecko:latest with the IMAGE ID in docker-compose.yml and save the file. The image lines inside the web, sidekiq and streaming services should look like this:
     image: 2197b82e5e84
  1. Run docker-compose up -d

Get sha256 hash necessary to pull an image:

docker images --digests

or

docker inspect --format='{{index .RepoDigests 0}}' <IMAGE ID>

Clean up disk space used by Docker

docker system prune -a

Note: The technique of pinning to a particular image mentioned above may be helpful for cleaning up disk space during an upgrade.

Prune dangling docker images

docker image prune -f

Database examination

sudo -u postgres psql ecko_production	
\l        		# show databases
\c ecko_production	# use database
\dt      		# show tables

This wiki contains documentation for ecko - community-driven social network software

Clone this wiki locally