computer-playbook/roles/docker-mastodon
2024-11-07 23:50:46 -03:00
..
tasks Restructured code and matrix rol 2024-01-19 15:12:18 +01:00
templates Updated mastodon configuration 2024-11-07 19:26:15 -03:00
vars changed default postgres logic and optimized discourse postgres integration 2024-01-05 11:27:04 +01:00
README.md Added migration comment to mastodon 2024-11-07 23:50:46 -03:00

docker mastodon

create configuration

    docker-compose run --rm web bundle exec rake mastodon:setup

Setup with existing configuration

docker-compose run --rm web bundle exec rails db:migrate

cleanup

cd {{path_docker_compose_instances}}mastodon/
docker-compose down
docker volume rm mastodon_data mastodon_database mastodon_redis
cd {{path_docker_compose_instances}} &&
rm -vR {{path_docker_compose_instances}}mastodon

access terminal

docker-compose exec -it web /bin/bash

set rights

After setting up mastodon you need to give the rights

docker-compose exec -it -u root web chown -R 991:991 public

Running Database Migrations

To ensure all required database tables and structures are in place after an update, you can run database migrations directly within the Mastodon web container. Use the following command:

docker compose exec -it web bash -c "RAILS_ENV=production bin/rails db:migrate"

This command enters the web container and runs migrations in production mode, updating the database structure to match the current version of the Mastodon software. If your Mastodon web container is named differently in your docker-compose.yml, replace web with the appropriate container name.

further information