processone / docker-ejabberd

Set of ejabberd Docker images
95 stars 77 forks source link

Cannot mount /conf to the host #95

Closed sw-dev1 closed 1 year ago

sw-dev1 commented 1 year ago

Using docker-compose.

Option 1: Follow the Customized Example:

volumes:
      - ./ejabberd.yml:/home/ejabberd/conf/ejabberd.yml:ro

Add (as suggested in Volumes):

- ./conf:/home/ejabberd/conf/

Problem: /conf is not mounted to the host, instead created as a docker volume.

Option 2:

volumes:
      - ./conf:/home/ejabberd/conf/

The custom ejabberd.yml is in /conf on the host

Problem: Log error: inetrc is missing The container starts with the default ejabberd.yml, conf is not mounted to the host, and not created as a docker volume.

badlop commented 1 year ago

I've tried now. Please check those examples:

With this example, the local file conf/ejabberd.yml is loaded to ejabberd, and used correctly:

version: '3.7'
services:
  main:
    image: ejabberd/ecs:latest
    ports:
      - "5222:5222"
      - "5280:5280"
    volumes:
      - ./conf/ejabberd.yml:/home/ejabberd/conf/ejabberd.yml:ro

With this example, all the local conf/ directory is mounted, this allows ejabberd to read ejabberd.yml, certificate files, additional configuration files, etc:

version: '3.7'
services:
  main:
    image: ejabberd/ecs:latest
    ports:
      - "5222:5222"
      - "5280:5280"
    volumes:
      - ./conf/:/home/ejabberd/conf/:ro
sw-dev1 commented 1 year ago

Thanks. :ro did the trick. Just as a side note: for me it works without the trailing/:

volumes:
      - ./conf:/home/ejabberd/conf:ro