mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-24 11:06:24 +02:00
- 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
52 lines
2.2 KiB
Django/Jinja
52 lines
2.2 KiB
Django/Jinja
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
|
|
|
mastodon:
|
|
{% set service_name = 'mastodon' %}
|
|
{% set container_port = 3000 %}
|
|
{% set container_healthcheck = 'health' %}
|
|
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 }}"
|
|
{% 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 service_name = 'streaming' %}
|
|
{% set container_port = 4000 %}
|
|
{% set container_healthcheck = 'api/v1/streaming/health' %}
|
|
container_name: {{ MASTODON_STREAMING_CONTAINER }}
|
|
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:
|
|
{% 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
|
|
{% 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' %} |