infrastructure/roles/ts3audiobot/templates/docker-compose.yml

61 lines
2.3 KiB
YAML
Raw Normal View History

{{ ansible_managed | comment }}
# Infrastructure
# Ansible instructions to deploy the infrastructure
# Copyright (C) 2020 Saibotk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
version: '2.1'
services:
ts3audiobot:
image: {{ ts3audiobot_baseimage }}:{{ ts3audiobot_image_version }}
mem_limit: 100mb
memswap_limit: 128mb
security_opt:
- no-new-privileges
{% if ts3audiobot_selinux_level != omit %}
- label=level:{{ ts3audiobot_selinux_level }}
{% endif %}
restart: always
volumes:
- "{{ ts3audiobot_data_location }}:/data"
{% if ts3audiobot_web_enabled %}
labels:
- "traefik.enable=true"
- "traefik.http.routers.ts3audiobot.rule=Host(`{{ ts3audiobot_traefik_domain }}`) && PathPrefix(`/`)"
- "traefik.http.routers.ts3audiobot.entrypoints=websecure"
- "traefik.http.routers.ts3audiobot.tls.certresolver={{ ts3audiobot_traefik_certresolver }}"
- "traefik.http.routers.ts3audiobot.middlewares=ts3audiobot,compress"
- "traefik.http.services.ts3audiobot.loadbalancer.server.port=58913"
- "traefik.http.middlewares.ts3audiobot.headers.sslredirect=true"
- "traefik.http.middlewares.ts3audiobot.headers.stsSeconds=63072000"
- "traefik.http.middlewares.ts3audiobot.headers.referrerPolicy=same-origin"
{% if proxy_hiddenservice is defined and proxy_hiddenservice.content is defined %}
- "traefik.http.middlewares.ts3audiobot.headers.customresponseheaders.alt-svc=h2={{ proxy_hiddenservice['content'] | b64decode | trim }}:443; ma=2592000"
{% endif %}
{% if proxy_network is defined %}
- "traefik.docker.network={{ proxy_network }}"
{% endif %}
{% endif %}
{% if proxy_network is defined %}
networks:
{{ proxy_network }}:
{% endif %}
{% if proxy_network is defined %}
networks:
{{ proxy_network }}:
external: true
{% endif %}