Files
computer-playbook/roles/web-app-mastodon/templates/docker-compose.yml.j2
Kevin Veen-Birkenbach 4f8ce598a9 Mastodon: allow internal chess host & refactor var names; OpenLDAP: safer get_app_conf
- Add ALLOWED_PRIVATE_ADDRESSES to .env (from svc-db-postgres) to handle 422 Mastodon::PrivateNetworkAddressError
- Switch docker-compose to MASTODON_* variables and align vars/main.yml
- Always run 01_setup.yml during deployment (removed conditional flag)
- OpenLDAP: remove implicit True default on network.local to avoid unintended truthy behavior

Context: chess.infinito.nexus resolved to 192.168.200.30 (private IP) from Mastodon; targeted allowlist unblocks federation lookups.

Ref: https://chat.openai.com/share/REPLACE_WITH_THIS_CONVERSATION_LINK
2025-09-03 21:44:47 +02:00

49 lines
2.1 KiB
Django/Jinja

{% include 'roles/docker-compose/templates/base.yml.j2' %}
web:
{% set container_port = 3000 %}
{% set container_healthcheck = 'health' %}
container_name: {{ MASTODON_NAME }}
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 }}"
{% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %}
ports:
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}"
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
volumes:
- data:/mastodon/public/system
{% include 'roles/docker-container/templates/networks.yml.j2' %}
streaming:
{% set container_port = 4000 %}
{% set container_healthcheck = 'api/v1/streaming/health' %}
container_name: {{ MASTODON_STREAMING_NAME }}
image: "{{ MASTODON_STREAMING_IMAGE }}:{{ MASTODON_STREAMING_VERSION }}"
{% include 'roles/docker-container/templates/base.yml.j2' %}
command: node ./streaming
{% include 'roles/docker-container/templates/healthcheck/wget.yml.j2' %}
ports:
- "127.0.0.1:{{ ports.localhost.websocket[application_id] }}:{{ container_port }}"
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
sidekiq:
container_name: {{ MASTODON_SIDEKIQ_NAME }}
image: "{{ MASTODON_IMAGE }}:{{ MASTODON_VERSION }}"
{% include 'roles/docker-container/templates/base.yml.j2' %}
command: bundle exec sidekiq
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
volumes:
- data:/mastodon/public/system
healthcheck:
test: ["CMD-SHELL", "pgrep -f sidekiq || exit 1"]
interval: 1m
timeout: 10s
retries: 3
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
data:
name: "{{ MASTODON_VOLUME }}"
{% include 'roles/docker-compose/templates/networks.yml.j2' %}