-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
70 lines (65 loc) · 2.13 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: '3.8'
services:
timescaledb:
image: timescale/timescaledb:latest-pg12
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- timescaledb-data:/var/lib/postgresql/data
- ./services/timescaledb/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./services/timescaledb/timescaledb.conf:/etc/postgresql/postgresql.conf
pgadmin:
image: dpage/pgadmin4
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
ports:
- "80:80"
volumes:
- pgadmin-data:/var/lib/pgadmin
mosquitto:
image: eclipse-mosquitto
ports:
- "1883:1883"
- "9001:9001"
- "8883:8883"
environment:
- MOSQUITTO_USERNAME=${MOSQUITTO_USERNAME}
- MOSQUITTO_PASSWORD=${MOSQUITTO_PASSWORD}
volumes:
- mosquitto-data:/mosquitto/data
- mosquitto-logs:/mosquitto/logs
- ./config/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
- ./config/mosquitto/mosquitto-entrypoint.sh:/mosquitto-entrypoint.sh
- ./config/mosquitto/password_file:/mosquitto/config/password_file
entrypoint: ["/mosquitto-entrypoint.sh"]
healthcheck:
test: ["CMD", "mosquitto_pub", "-h", "localhost", "-t", "test", "-m", "test", "-u", "${MOSQUITTO_USERNAME}", "-P", "${MOSQUITTO_PASSWORD}"]
interval: 1m
retries: 3
start_period: 10s
device_simulation:
build: ./services/device_simulation
environment:
- MQTT_BROKER=${MQTT_BROKER}
- MQTT_PORT=${MQTT_PORT}
- MQTT_PUBLISH_TOPIC=${MQTT_PUBLISH_TOPIC}
- MQTT_SUBSCRIBE_TOPIC=${MQTT_SUBSCRIBE_TOPIC}
- MQTT_USERNAME=${MOSQUITTO_USERNAME}
- MQTT_PASSWORD=${MOSQUITTO_PASSWORD}
- DEVICE_ID=${DEVICE_ID}
- SENSOR_NAME=${SENSOR_NAME}
depends_on:
mosquitto:
condition: service_healthy
volumes:
- ./config/device/device_config.json:/app/config/device/device_config.json
volumes:
timescaledb-data:
pgadmin-data:
mosquitto-data:
mosquitto-logs: