Mastodon on Raspberry pi

Official Mastodon github doc says that the following softwares are required to run Mastodon.

  1. Nginx
  2. Docker
  3. Docker-compose

Nginx is userd as a reverse proxy. Docker can be installed by the below command written in official Raspbian doc.

curl -sSL https://get.docker.com | sh

However, official docker-compose can’t be used because it doesn’t compatible to Raspberry pi ARM CPU.

There is a docker-compose for ARM project, arm-compose in github. Though the readme says it isn’t maintaind anymore, anyway go ahead. Installation commands are written in the readme.

Not only docker-compose, official Mastodon docker image doesn’t work in ARM CPU environment as well, but there is a docker image for ARM, rpi-mastodon . However, using this original image we can’t compile Mastodon javascript later as menthioned in this Issue. Modified Dockerfile is here.

Though we can build rpi-mastodon images by docker build command as written in documents,  there is another problem. After precompile, when I access https://localhost:3000, browser says that

404 /javascripts/application.js 
404 /stylesheets/application.css

The problem is also mentioned in this Issue. Checking inside mastodon-web container, actually these files didn’t exist.

$ docker exec -it {container id of mastodon-web} /bin/sh

# ls public/javascripts/application.js
No such file or directory

# ls public/stylesheets/application.css
No such file or directory

The precompiled files are found in public/assets directory with different names.

# ls public/assets/application-ead9c7441f487a0fef44a4e7e1129e67ca5ad203a91762b
d6ec6f32850046b2f.js

# ls public/assets/application-b7d32e1a05cf50241f3074c5038f423a251e081f210ad7f
dc238029d85f502f2.css

After copy or symlink these files inside public/javascripts or stylesheets directory, it worked. Other application_public.js or some images are also located in public/assets directory, so copy or symlink them as well.

Leave a Reply

Your email address will not be published. Required fields are marked *