Skip to content

Commit

Permalink
Added sample docker compose config moquitto
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartendeKruijf committed Mar 13, 2024
1 parent 7a79ef0 commit ee11b7a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docker/mqtt/config/mosquitto.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
listener 1883
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log

## Authentication ##
# By default, Mosquitto >=2.0 allows only authenticated connections. Change to true to enable anonymous connections.
allow_anonymous true
# password_file /mosquitto/config/password.txt
Empty file added docker/mqtt/data/.gitkeep
Empty file.
44 changes: 44 additions & 0 deletions docker/mqtt/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: '3.7'
services:
mosquitto:
image: eclipse-mosquitto
container_name: mosquitto
volumes:
- type: volume
source: mosquitto_config
target: /mosquitto/config
- type: volume
source: mosquitto_data
target: /mosquitto/data
- type: volume
source: mosquitto_log
target: /mosquitto/log
ports:
- target: 1883
published: 1883
protocol: tcp
mode: host
- target: 9001
published: 9001
protocol: tcp
mode: host

volumes:
mosquitto_config:
driver: local # Define the driver and options under the volume name
driver_opts:
type: none
device: ./config
o: bind
mosquitto_data:
driver: local # Define the driver and options under the volume name
driver_opts:
type: none
device: ./data
o: bind
mosquitto_log:
driver: local # Define the driver and options under the volume name
driver_opts:
type: none
device: ./log
o: bind
Empty file added docker/mqtt/log/.gitkeep
Empty file.

0 comments on commit ee11b7a

Please sign in to comment.