Quick guide for doing dev setup on Mastodon hosted on Docker:

1. Make sure web is set to build locally in docker-compose.yml. The build line should read as below and image should be commented out:

web:
build: .
# image: tootsuite/mastodon:v3.4.1

2. Do the code change

3. Run: sudo docker-compose build
This will do the build. Using docker will take a longer time as opposed to installing mastodon directly. It should take 5 minutes on a 2GB RAM machine. If it is taking longer than 10 minutes then it is probably stuck. To fix it, you will need to increase swap space to 4GB and then restart the build process.

If you change the swap space, remember to restart docker daemon by running: sudo /etc/init.d/docker restart

4. Run: sudo docker-compose stop
5. Run: sudo docker-compose up -d
6. To see error logs: docker logs mastodon_web_1

goonj

Goonj is an open, privacy conscious social network.