47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
customer-api:
|
|
build: .
|
|
container_name: "customer-api"
|
|
ports:
|
|
- "5000:5000"
|
|
depends_on:
|
|
- mongo
|
|
- mosquitto
|
|
environment:
|
|
- MONGO_URI=mongodb://mongo:27017/mydb
|
|
- LOCAL_BROKER_USERNAME=main
|
|
- LOCAL_BROKER_PASSWORD=hepl
|
|
- LOCAL_BROKER_ADDRESS=customer-broker
|
|
- LOCAL_BROKER_PORT=1883
|
|
- API_BROKER_ADDRESS=192.168.15.120
|
|
- API_BROKER_PORT=1883
|
|
|
|
mongo:
|
|
image: mongo:latest
|
|
container_name: "customer-database"
|
|
environment:
|
|
- MONGO_INITDB_DATABASE=customer-db
|
|
- MONGO_INITDB_ROOT_PASSWORD=secret
|
|
- MONGO_INITDB_ROOT_USERNAME=root
|
|
ports:
|
|
- "27017:27017"
|
|
volumes:
|
|
- ./mongo-data:/data/db
|
|
- ./mongo-init:/docker-entrypoint-initdb.d
|
|
|
|
mosquitto:
|
|
image: eclipse-mosquitto:latest
|
|
container_name: "customer-broker"
|
|
ports:
|
|
- "1883:1883"
|
|
- "8883:8883"
|
|
command: ["sh", "/mosquitto/config/init-mosquitto.sh"]
|
|
volumes:
|
|
- ./mosquitto/config:/mosquitto/config
|
|
- ./mosquitto/data:/mosquitto/data
|
|
- ./mosquitto/log:/mosquitto/log
|
|
- ./mosquitto/certs:/mosquitto/certs
|
|
|