| 63 | |
| 64 | == Docker compose == |
| 65 | |
| 66 | The owner and permission of each file |
| 67 | {{{ |
| 68 | [root@Mosh Mosquitto]# tree . |
| 69 | . |
| 70 | ├── docker-compose.yml |
| 71 | └── mosquitto |
| 72 | ├── config |
| 73 | │ ├── acls.conf |
| 74 | │ ├── mosquitto.conf |
| 75 | │ └── passwd |
| 76 | ├── data |
| 77 | │ └── mosquitto.db |
| 78 | └── log |
| 79 | └── mosquitto.log |
| 80 | |
| 81 | 4 directories, 6 files |
| 82 | [root@Mosh Mosquitto]# ls -l mosquitto/log/ |
| 83 | total 8 |
| 84 | -rwxr-xr-x 1 krit krit 5963 Aug 29 11:38 mosquitto.log |
| 85 | [root@Mosh Mosquitto]# ls -l mosquitto/data/ |
| 86 | total 4 |
| 87 | -rw------- 1 krit krit 47 Aug 29 11:36 mosquitto.db |
| 88 | [root@Mosh Mosquitto]# |
| 89 | |
| 90 | }}} |
| 91 | |
| 92 | docker-compose.yml file should be following. Pls note user: "1000:1000" the number 1000 from command to check your '''id -u''' and '''id -g'''. |
| 93 | {{{ |
| 94 | mosquitto: |
| 95 | image: eclipse-mosquitto |
| 96 | hostname: mosquitto |
| 97 | container_name: mosquitto |
| 98 | user: "1000:1000" |
| 99 | ports: |
| 100 | - 1883:1883 |
| 101 | - 9001:9001 |
| 102 | volumes: |
| 103 | - ./mosquitto/config:/mosquitto/config |
| 104 | - ./mosquitto/log:/mosquitto/log |
| 105 | - ./mosquitto/data:/mosquitto/data |
| 106 | }}} |