infrastructure/roles/mastodon/templates/mastodon-streaming.container.j2

44 lines
1.2 KiB
Django/Jinja

{{ ansible_managed | comment }}
[Unit]
Description = Mastodon Streaming Server
Requires = mastodon-postgres.service mastodon-redis.service
After = mastodon-postgres.service mastodon-redis.service
[Service]
Restart = always
RestartSec = 5s
[Container]
Image = {{ mastodon_streaming_containerimage }}:{{ mastodon_image_tag }}
ContainerName = mastodon-streaming
HealthCmd = CMD-SHELL curl -s --noproxy localhost localhost:4000/api/v1/streaming/health | grep -q 'OK' || exit 1
Exec = node ./streaming/index.js
AutoUpdate = registry
LogDriver = journald
NoNewPrivileges = true
DropCapability = all
UserNS = auto:size=65535
{% if mastodon_selinux_level != omit %}
SecurityLabelLevel = {{ mastodon_selinux_level }}
{% endif %}
Network = mastodon-backend.network:alias=backend-mastodon-streaming
ExposeHostPort = 4000
EnvironmentFile = {{ mastodon_install_location }}/mastodon.env
Volume = mastodon-postgres-socket:/var/run/postgresql:z
Volume = mastodon-redis-socket:/run/redis:z
PodmanArgs = --memory={{ mastodon_memory_high }}
PodmanArgs = --memory-swap={{ mastodon_swap_max }}
PodmanArgs = --memory-reservation={{ mastodon_memory_low }}
[Install]
WantedBy = default.target