ansible-zammad/roles/zammad/templates/docker-compose.yml.j2

168 lines
4.1 KiB
Plaintext
Raw Permalink Normal View History

2023-09-25 18:42:20 +02:00
---
services:
init:
image: 'zammad/zammad-docker-compose:{{ zammad_version | mandatory }}'
restart: on-failure
command:
- zammad-init
depends_on:
- postgres
environment:
<<: &cache
MEMCACHE_SERVERS: 'memcached:11211'
REDIS_URL: 'redis://redis:6379'
{% if zammad_enable_search %}
ELASTICSEARCH_HOST: search
ELASTICSEARCH_REINDEX: '${ELASTICSEARCH_REINDEX:-false}'
{% else %}
ELASTICSEARCH_ENABLED: 'false'
{% endif %}
POSTGRESQL_DB: '{{ zammad_database_name }}'
POSTGRESQL_DB_CREATE: 'false'
POSTGRESQL_HOST: postgres
POSTGRESQL_PASS: '{{ zammad_database_password | mandatory }}'
POSTGRESQL_USER: '{{ zammad_database_user }}'
networks:
- internal
volumes:
- /srv/zammad/zammad:/opt/zammad
memcached:
image: 'memcached:{{ zammad_memcached_version }}-alpine'
restart: unless-stopped
command:
- memcached
- -m
- '{{ zammad_memcached_memory }}'
deploy:
resources:
limits:
memory: '{{ zammad_memcached_memory_limit }}'
networks:
- internal
nginx:
image: 'zammad/zammad-docker-compose:{{ zammad_version | mandatory }}'
restart: unless-stopped
command:
- zammad-nginx
depends_on:
- railsserver
environment:
NGINX_SERVER_SCHEME: 'https'
ZAMMAD_RAILSSERVER_HOST: 'railsserver'
ZAMMAD_WEBSOCKET_HOST: 'websocket'
expose:
- 8080
networks:
- internal
- traefik
volumes:
- /srv/zammad/zammad:/opt/zammad
labels:
traefik.enable: 'true'
traefik.docker.network: traefik
traefik.http.routers.zammad.entrypoints: websecure
traefik.http.routers.zammad.rule: '({{ zammad_rule | mandatory }}) && !Path(`/auth/sso`)'
traefik.http.routers.zammad.tls.certresolver: lehttp
postgres:
image: git.luj0ga.de/luca/postgres-tcpify:1
restart: unless-stopped
networks:
- internal
volumes:
- /var/run/postgresql:/var/run/postgresql
railsserver:
image: 'zammad/zammad-docker-compose:{{ zammad_version | mandatory }}'
restart: unless-stopped
command:
- zammad-railsserver
depends_on:
- memcached
- postgres
- redis
environment:
<<: *cache
ZAMMAD_WEB_CONCURRENCY: '{{ zammad_num_workers }}'
networks:
- internal
volumes:
- /srv/zammad/zammad:/opt/zammad
redis:
image: 'redis:{{ zammad_redis_version }}-alpine'
restart: unless-stopped
deploy:
resources:
limits:
memory: '{{ zammad_redis_memory_limit }}'
networks:
- internal
scheduler:
image: 'zammad/zammad-docker-compose:{{ zammad_version | mandatory }}'
restart: unless-stopped
command:
- zammad-scheduler
depends_on:
- memcached
- railsserver
- redis
environment: *cache
networks:
- internal
volumes:
- /srv/zammad/zammad:/opt/zammad
{% if zammad_enable_search %}
search:
build: opensearch
image: 'opensearch-ingest-attachment:{{ zammad_opensearch_version | mandatory }}'
restart: unless-stopped
deploy:
resources:
limits:
memory: '{{ zammad_opensearch_memory_limit }}'
environment:
DISABLE_INSTALL_DEMO_CONFIG: 'true'
DISABLE_SECURITY_PLUGIN: 'true'
OPENSEARCH_JAVA_OPTS: '-Xms{{ zammad_opensearch_memory_min }} -Xmx{{ zammad_opensearch_memory_max }}'
bootstrap.memory_lock: 'true'
compatibility.override_main_response_version: 'true'
discovery.type: single-node
networks:
- internal
ulimits:
memlock:
hard: -1
soft: -1
nofile:
hard: 65536
soft: 65536
volumes:
- /srv/zammad/search:/usr/share/opensearch/data
{% endif %}
websocket:
image: 'zammad/zammad-docker-compose:{{ zammad_version | mandatory }}'
restart: unless-stopped
command:
- zammad-websocket
depends_on:
- memcached
- railsserver
- redis
environment: *cache
networks:
- internal
volumes:
- /srv/zammad/zammad:/opt/zammad
networks:
internal:
traefik:
external: yes