Parameterized docker-compose.yml file using .env

This commit is contained in:
B.J. Dweck 2020-10-23 10:45:57 +02:00
parent ab9b6fc372
commit 75a2512438
9 changed files with 10 additions and 6 deletions

4
.env.example Normal file
View File

@ -0,0 +1,4 @@
BROKER_MQTT_PORT=1883
BROKER_MQTTS_PORT=8883
HTTP_PORT=7700
CONFIG_DIR=./example-config

View File

@ -6,7 +6,7 @@ services:
build:
context: ./tor
args:
- SVC_PORT=1883
- SVC_PORT=${BROKER_MQTT_PORT}
- SVC_HOST=broker
networks:
- tor_net
@ -15,10 +15,10 @@ services:
image: eclipse-mosquitto
volumes:
- broker_data:/mosquitto/data
- ./config:/mosquitto/config:ro
- ${CONFIG_DIR}:/mosquitto/config:ro
ports:
- "1883:1883"
- "8883:8883"
- ${BROKER_MQTT_PORT}:${BROKER_MQTT_PORT}
- ${BROKER_MQTTS_PORT}:${BROKER_MQTTS_PORT}
networks:
- tor_net
- broker_net
@ -27,9 +27,9 @@ services:
build: './subscriber'
volumes:
- client_data:/data
- ./config:/etc/torch:ro
- ${CONFIG_DIR}:/etc/torch:ro
ports:
- "7700:8080"
- ${HTTP_PORT}:8080
networks:
- broker_net