I have a couple of issues deploying mosquitto, I hope someone can shine a light on it.
I am using docker compose and want to add the container to a custom network (called mynetwork)
Besides that, I want to use the password file I have created (mosquitto.passwd)
What happens when I deploy the container with docker-compose:
- The container runs, but not in the defined network.
it mentions Stack: docker, dont know why.
No ports are published, although I have defined some ports to be published.
I have a mosquitto.conf file and a mosquitto.passwd file which I would like to deploy automatically using my docker-compose script, how do I do that ?
Below my compose script and config file
compose file:
version: '3.8'
services:
######################################
# Mosquitto (mqtt)
######################################
mqtt:
image: eclipse-mosquitto:2.0
hostname: mqtt
container_name: mqtt
restart: always
volumes:
- /docker/mqtt/data:/mosquitto/data
- /docker/mqtt/config:/mosquitto/config
- /docker/mqtt/log:/mosquitto/log
ports:
- "1883:1883"
network_mode: "mynetwork"
environment:
- TZ=Europe/Amsterdam
command: "mosquitto -c /mosquitto/config/mosquitto.conf"
config file:
persistence true
persistence_location /docker/mqtt/data/
log_dest file /docker/mqtt/log/mosquitto.log
## Authentication ##
allow_anonymous true
password_file /docker/mqtt/mosquitto.passwd