-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
143 lines (135 loc) · 3.95 KB
/
Copy pathcompose.yaml
File metadata and controls
143 lines (135 loc) · 3.95 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: tesla-dashboard
services:
database:
image: ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/tesla-dashboard-postgres:${IMAGE_TAG:-latest}
restart: unless-stopped
environment:
POSTGRES_USER: ${TM_DB_USER:-teslamate}
POSTGRES_PASSWORD: ${TM_DB_PASS}
POSTGRES_DB: ${TM_DB_NAME:-teslamate}
volumes:
- teslamate-db:/var/lib/postgresql
- ./:/backup-source:ro
networks:
- data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${TM_DB_USER:-teslamate} -d ${TM_DB_NAME:-teslamate}"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
security_opt:
- no-new-privileges:true
mosquitto:
image: ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/eclipse-mosquitto:${MOSQUITTO_TAG:-2}
restart: unless-stopped
command: mosquitto -c /mosquitto-no-auth.conf
volumes:
- mosquitto-conf:/mosquitto/config
- mosquitto-data:/mosquitto/data
networks:
- data
security_opt:
- no-new-privileges:true
teslamate:
image: ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/teslamate:${TESLAMATE_TAG:-latest}
restart: unless-stopped
depends_on:
database:
condition: service_healthy
mosquitto:
condition: service_started
environment:
ENCRYPTION_KEY: ${TM_ENCRYPTION_KEY}
DATABASE_USER: ${TM_DB_USER:-teslamate}
DATABASE_PASS: ${TM_DB_PASS}
DATABASE_NAME: ${TM_DB_NAME:-teslamate}
DATABASE_HOST: database
MQTT_HOST: mosquitto
CHECK_ORIGIN: "false"
URL_PATH: /
TZ: ${TZ:-Asia/Shanghai}
volumes:
- ./import:/opt/app/import
expose:
- "4000"
networks:
- data
cap_drop:
- all
db-init:
image: ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/tesla-dashboard-postgres:${IMAGE_TAG:-latest}
restart: "no"
depends_on:
database:
condition: service_healthy
environment:
POSTGRES_HOST: database
POSTGRES_USER: ${TM_DB_USER:-teslamate}
POSTGRES_PASSWORD: ${TM_DB_PASS}
POSTGRES_DB: ${TM_DB_NAME:-teslamate}
DASHBOARD_DB_USER: ${DASHBOARD_DB_USER:-dashboard_readonly}
DASHBOARD_DB_PASSWORD: ${DASHBOARD_DB_PASSWORD}
command: ["sh", "/usr/local/share/tesla-dashboard/create-dashboard-role.sh"]
networks:
- data
security_opt:
- no-new-privileges:true
api:
image: ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/tesla-dashboard-api:${IMAGE_TAG:-latest}
restart: unless-stopped
depends_on:
db-init:
condition: service_completed_successfully
environment:
DATABASE_HOST: database
DATABASE_NAME: ${TM_DB_NAME:-teslamate}
DATABASE_USER: ${DASHBOARD_DB_USER:-dashboard_readonly}
DATABASE_PASSWORD: ${DASHBOARD_DB_PASSWORD}
DISPLAY_TIME_ZONE: ${DISPLAY_TIME_ZONE:-Asia/Shanghai}
STATEMENT_TIMEOUT_MS: ${STATEMENT_TIMEOUT_MS:-15000}
DB_POOL_MIN_SIZE: ${DB_POOL_MIN_SIZE:-1}
DB_POOL_MAX_SIZE: ${DB_POOL_MAX_SIZE:-5}
networks:
- app
- data
expose:
- "8000"
healthcheck:
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3)\""]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
security_opt:
- no-new-privileges:true
web:
image: ${IMAGE_REGISTRY}/${IMAGE_NAMESPACE}/tesla-dashboard-web:${IMAGE_TAG:-latest}
restart: unless-stopped
depends_on:
api:
condition: service_started
teslamate:
condition: service_started
environment:
BASIC_AUTH_USER: ${BASIC_AUTH_USER:-admin}
BASIC_AUTH_PASSWORD: ${BASIC_AUTH_PASSWORD}
ports:
- "${WEB_PORT:-80}:80"
networks:
- app
- data
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/nginx-health >/dev/null 2>&1"]
interval: 30s
timeout: 5s
retries: 3
security_opt:
- no-new-privileges:true
networks:
app:
data:
volumes:
teslamate-db:
mosquitto-conf:
mosquitto-data: