-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
49 lines (45 loc) · 1.33 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
version: '3.7'
services:
mqtt-api:
environment:
- MQTT_BROKER_PORT=1884
- WS_BROKER_PORT=3001
build:
context: .
dockerfile: ./config/docker/broker.dockerfile
image: test/mqtt-api:latest
restart: always
ports:
- '127.0.0.1:1884:1884'
- '127.0.0.1:3001:3001'
mqtt-api-2:
environment:
- MQTT_BROKER_PORT=1885
- WS_BROKER_PORT=3002
build:
context: .
dockerfile: ./config/docker/broker.dockerfile
image: test/mqtt-api:latest
restart: always
ports:
- '127.0.0.1:1885:1885'
- '127.0.0.1:3002:3002'
api-proxy:
environment:
- MQTT_BROKER_PORT=1883
- MQTTS_BROKER_PORT=8883
- HTTP_SERVER_PORT=80
- HTTPS_SERVER_PORT=443
- NGINX_SERVER_HOST=ed-X510URR
image: nginx:latest
restart: always
volumes:
- ./config/nginx/nginx.template:/etc/nginx/nginx.template
- ./deploy/key.pem:/etc/nginx/certs/key.pem
- ./deploy/cert.pem:/etc/nginx/certs/cert.pem
- ./log/nginx:/etc/nginx/log
depends_on:
- mqtt-api
- mqtt-api-2
network_mode: host
command: /bin/bash -c "envsubst '$${HTTP_SERVER_PORT},$${HTTPS_SERVER_PORT},$${MQTT_BROKER_PORT},$${MQTTS_BROKER_PORT},$${NGINX_SERVER_HOST}' < /etc/nginx/nginx.template > /etc/nginx/nginx.conf && exec nginx -g 'daemon off;'"