mastodon: tighten resources, robust exec tasks, and env defaults

- resources: per-service cpus/mem/pids for mastodon/streaming/sidekiq/redis/db
- compose: rename service key to "mastodon" (was: web), set service_name blocks
- tasks(01_setup): run rails db:migrate via docker exec (non-tty, login shell)
- tasks(02_administrator): healthchecks for 'mastodon', sed with absolute path,
  tootctl as user 'mastodon' (non-tty), optional re-health wait
- env.j2: add RAILS_ENV={{ ENVIRONMENT | default('production') }}
- resource.yml.j2: fix get_app_conf path (service_name default spacing)
- docs: remove outdated Installation/Administration files

Context: https://chatgpt.com/share/68d332a0-ae98-800f-b418-c0d0262eaa2e
This commit is contained in:
2025-09-24 01:52:18 +02:00
parent 426ba32c11
commit 9bf77e1e35
10 changed files with 51 additions and 96 deletions

View File

@@ -1,9 +1,10 @@
{% include 'roles/docker-compose/templates/base.yml.j2' %}
web:
mastodon:
{% set service_name = 'mastodon' %}
{% set container_port = 3000 %}
{% set container_healthcheck = 'health' %}
container_name: {{ MASTODON_NAME }}
container_name: {{ MASTODON_CONTAINER }}
image: "{{ MASTODON_IMAGE }}:{{ MASTODON_VERSION }}"
{% include 'roles/docker-container/templates/base.yml.j2' %}
command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p {{ container_port }}"
@@ -16,9 +17,10 @@
{% include 'roles/docker-container/templates/networks.yml.j2' %}
streaming:
{% set service_name = 'streaming' %}
{% set container_port = 4000 %}
{% set container_healthcheck = 'api/v1/streaming/health' %}
container_name: {{ MASTODON_STREAMING_NAME }}
container_name: {{ MASTODON_STREAMING_CONTAINER }}
image: "{{ MASTODON_STREAMING_IMAGE }}:{{ MASTODON_STREAMING_VERSION }}"
{% include 'roles/docker-container/templates/base.yml.j2' %}
command: node ./streaming
@@ -29,7 +31,8 @@
{% include 'roles/docker-container/templates/networks.yml.j2' %}
sidekiq:
container_name: {{ MASTODON_SIDEKIQ_NAME }}
{% set service_name = 'sidekiq' %}
container_name: {{ MASTODON_SIDEKIQ_CONTAINER }}
image: "{{ MASTODON_IMAGE }}:{{ MASTODON_VERSION }}"
{% include 'roles/docker-container/templates/base.yml.j2' %}
command: bundle exec sidekiq