Skip to content

Instantly share code, notes, and snippets.

@LizenzFass78851
Last active March 1, 2025 11:44
Show Gist options
  • Save LizenzFass78851/24a3857bb35352e8b6f5e12fe4d7fdeb to your computer and use it in GitHub Desktop.
Save LizenzFass78851/24a3857bb35352e8b6f5e12fe4d7fdeb to your computer and use it in GitHub Desktop.
experimental and definitely not recommended mayan-edms docker-compose.yml with elasticsearch and without rabbitmq
version: '3.7'
services:
mayan:
image: mayanedms/mayanedms:s4.8
container_name: mayan-edms
restart: always
ports:
- "8000:8000"
volumes:
- mayan_media:/var/lib/mayan
- mayan_settings:/etc/mayan
environment:
MAYAN_APT_INSTALLS: "tesseract-ocr-deu"
MAYAN_DATABASES: "{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayandbpass','USER':'mayan','HOST':'db','PORT':'5432'}}"
MAYAN_CELERY_BROKER_URL: redis://:mayanredispassword@redis:6379/0
MAYAN_CELERY_RESULT_BACKEND: redis://:mayanredispassword@redis:6379/1
MAYAN_LOCK_MANAGER_BACKEND: mayan.apps.lock_manager.backends.redis_lock.RedisLock
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS: "{'redis_url':'redis://:mayanredispassword@redis:6379/2'}"
MAYAN_SEARCH_BACKEND: mayan.apps.dynamic_search.backends.elasticsearch.ElasticSearchBackend
MAYAN_SEARCH_BACKEND_ARGUMENTS: "{'client_hosts':['http://elasticsearch:9200'],'client_http_auth':['elastic','mayanespassword']}"
depends_on:
- db
- redis
- elasticsearch
db:
command:
- "postgres"
- "-c"
- "default_statistics_target=200"
- "-c"
- "maintenance_work_mem=128MB"
- "-c"
- "max_connections=150"
- "-c"
- "shared_buffers=512MB"
- "-c"
- "work_mem=32MB"
image: postgres:14-alpine
container_name: mayan-db
restart: always
environment:
POSTGRES_DB: mayan
POSTGRES_USER: mayan
POSTGRES_PASSWORD: mayandbpass
shm_size: 128m
healthcheck:
test: ["CMD", "pg_isready", "--username", "mayan"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
- mayan_db:/var/lib/postgresql/data
redis:
command:
- redis-server
- --appendonly
- "no"
- --databases
- "3"
- --maxmemory
- "100mb"
- --maxclients
- "500"
- --maxmemory-policy
- "allkeys-lru"
- --save
- ""
- --tcp-backlog
- "256"
- --requirepass
- "mayanredispassword"
image: redis:7.4-alpine
container_name: mayan-redis
restart: always
volumes:
- mayan_redis:/data
elasticsearch:
image: elasticsearch:7.17.25
container_name: mayan-elasticsearch
restart: always
environment:
- discovery.type=single-node
- xpack.security.enabled=true
- bootstrap.memory_lock=true
- http.max_content_length=400mb
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- ELASTIC_PASSWORD=mayanespassword
volumes:
- mayan_elasticsearch:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
volumes:
mayan_media:
mayan_settings:
mayan_db:
mayan_redis:
mayan_elasticsearch:

replace previous search backend to elasticsearch

In case of a conversion of an existing instance from another search basin to elasticsearch,

      MAYAN_SEARCH_BACKEND: mayan.apps.dynamic_search.backends.elasticsearch.ElasticSearchBackend
      MAYAN_SEARCH_BACKEND_ARGUMENTS: "{'client_hosts':['http://elasticsearch:9200']}"

or

      MAYAN_SEARCH_BACKEND: mayan.apps.dynamic_search.backends.elasticsearch.ElasticSearchBackend
      MAYAN_SEARCH_BACKEND_ARGUMENTS: "{'client_hosts':['http://elasticsearch:9200'],'client_http_auth':['elastic','mayanespassword']}"

the following commands after conversion via environment:

docker compose run --rm mayan run_command search_initialize
docker compose run --rm mayan run_command search_reindex

Replace "mayan" with the service name of your own docker compose stack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment