hometown-fork / hometown

A supported fork of Mastodon that provides local posting and a wider range of content types.
GNU Affero General Public License v3.0
734 stars 56 forks source link

Modified Dockerfile to resolve build errors #1334

Open hjhornbeck opened 9 months ago

hjhornbeck commented 9 months ago

Had to modify the Dockerfile a bit to resolve some issues. In order of occurrence:

  1. Significant changes were made to the way Mastodon is built. These may not have been necessary, but they do align with what's in v4.2's Dockerfile, so I'm sticking with them.
  2. A redundant change to the container's PATH variable was eliminated. Not an issue per-se, but I was debugging the thing anyway.
  3. Two dependencies were missing, libjemalloc2 and libyaml-dev, the former of which was necessary to run Ruby, while the latter was used by a library.
  4. Installing yarn would cause a failure, as it was already on the filesystem. Rather than upgrade, the old version was retained.
  5. Pre-compiling the assets would consistently fail, with a message that a Ruby package was missing/partly installed. Adding another bundle install call fixed this.

After those changes, sudo docker compose build && sudo docker compose up -d worked without issue for the instance I run, and I have yet to notice any data loss.