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

45 lines
1.1 KiB
Django/Jinja

{{ ansible_managed | comment }}
[Unit]
Description = Mastodon Sidekiq Server
Requires = mastodon-postgres.service mastodon-redis.service
After = mastodon-postgres.service mastodon-redis.service
[Service]
Restart = always
RestartSec = 5s
[Container]
Image = {{ mastodon_containerimage }}:{{ mastodon_image_tag }}
ContainerName = mastodon-sidekiq
HealthCmd = CMD-SHELL ps aux | grep '[s]idekiq\ 6' || false
Exec = bundle exec sidekiq
# AutoUpdate = registry
LogDriver = journald
NoNewPrivileges = true
DropCapability = all
UserNS = container:mastodon-web
{% if mastodon_selinux_level != omit %}
SecurityLabelLevel = {{ mastodon_selinux_level }}
{% endif %}
Network = mastodon-frontend.network
Network = mastodon-backend.network
EnvironmentFile = {{ mastodon_install_location }}/mastodon.env
Volume = {{ mastodon_public_location }}:/mastodon/public/system
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