Install openhab3 using docker-compose with external volume

Hello everyone,

I’m new to Docker, and I’d like to get Openhab3 working.

My setup:
Raspberry Pi 4 8GB
Raspberry Pi OS ARM64, lite (no desktop)
Docker: version 20.10.5, build 55c4c88
docker-compose: version 1.28.5, build unknown

I already had a look into the Docker Hub documentation about openhab3 (Docker Hub)

I like to have the possibility to access the /openhab/conf folder directly from my home path (e.g. /home/pi/openhab/conf). So that I can easily edit all attached files with my standard user. How should the docker-compose.yml file look like, and what kind of permissions do I need to grant?

Thank you very much in advance.

BR,
Julian

Based on what you read in the documentation, what configuration did you try and what about it did not work?

Please use code fences when posting your config file contents.
How to use code fences - Tutorials & Examples - openHAB Community

This is my docker-compose.yml - is it correct?
Do I need to add some more information?

version: '2.2'

services:
  openhab:
    image: "openhab/openhab:3.0.1"
    restart: always
    network_mode: host
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
      - "/home/pi/docker/openhab/addons:/openhab/addons"
      - "/home/pi/docker/openhab/conf:/openhab/conf"
      - "/home/pi/docker/openhab/userdata:/openhab/userdata"
    environment:
      USER_ID: "1000"
      GROUP_ID: "1000"
      OPENHAB_HTTP_PORT: "8080"
      OPENHAB_HTTPS_PORT: "8443"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"

I assume your system openhab user has user id of 1000 and openhab group id of 1000?

The openhab user & group owns the volume mount points?

What exactly is not working?

I have installed openHab just adapting your configuration to my environment e it works.

Bye