forked from lephisto/tesla-apiscraper
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
81 lines (71 loc) · 2.59 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
71
72
73
74
75
76
77
78
79
80
81
version: '2.4'
##############################################################################################
# TEMPLATES
##############################################################################################
# Extendable apiscraper config. Not an actual service.
# See https://docs.docker.com/compose/compose-file/#extension-fields
x-apiscraper:
&default-apiscraper
build:
context: .
dockerfile: Dockerfile.compose
restart: on-failure:5
links:
- influxdb
command: ["/tesla-apiscraper/scripts/wait-for-it.sh", "influxdb:8086", "--", "python3", "/tesla-apiscraper/apiscraper.py"]
services:
##############################################################################################
# DEPENDENCIES
##############################################################################################
influxdb:
image: "influxdb:latest"
container_name: "influxdb_apiscraper"
environment:
- INFLUXDB_DB="tesla"
volumes:
- ./data/influxdb:/var/lib/influxdb
healthcheck:
test: "curl -X HEAD -f http://localhost:8086/ping"
interval: 3s
timeout: 10s
retries: 5
grafana:
image: grafana/grafana:latest
container_name: "grafana_apiscraper"
environment:
- GF_INSTALL_PLUGINS=natel-discrete-panel,https://mephis.to/grafana-trackmap-panel/dist.zip;grafana-trackmap-panel
# - GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s/grafana/ <<< Set this if you want to hide Grafana begind a subpath, eg: https://yourhomeseerver.url/grafana/
ports:
# HOST:CONTAINER
- "3000:3000"
links:
- influxdb
user: "472"
volumes:
- ./data/grafana:/var/lib/grafana
- ./provisioning/:/etc/grafana/provisioning
##############################################################################################
# APPLICATION
##############################################################################################
apiscraper:
<< : *default-apiscraper
ports:
- "8023:8023"
volumes:
- ./config.py:/tesla-apiscraper/config.py
- ./apiscraper.log:/tesla-apiscraper/apiscraper.log
# Uncomment for more cars. Write config-{n}.py and apiscraper-{n}.log files.
# apiscraper-1:
# << : *default-apiscraper
# volumes:
# - ./config-1.py:/tesla-apiscraper/config.py
# - ./apiscraper-1.log:/tesla-apiscraper/apiscraper.log
# ports:
# - "8024:8023"
# apiscraper-2:
# << : *default-apiscraper
# volumes:
# - ./config-2.py:/tesla-apiscraper/config.py
# - ./apiscraper-2.log:/tesla-apiscraper/apiscraper.log
# ports:
# - "8025:8023"