-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
177 lines (177 loc) · 5.13 KB
/
compose.yaml
File metadata and controls
177 lines (177 loc) · 5.13 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: orchidarium
services:
grafana:
image: grafana/grafana:9.5.20
container_name: grafana
depends_on:
influxdb:
condition: service_started
mysql:
condition: service_healthy
volumes:
# Certs
- ./certs/cert.pem:/etc/grafana/cert.pem:ro
- ./certs/key.pem:/etc/grafana/key.pem:ro
# Config
- ./grafana/config.ini:/etc/grafana/grafana.ini:ro
environment:
- TERM=linux
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-polystat-panel
- GF_PATHS_CONFIG=/etc/grafana/grafana.ini
- GF_PATHS_DATA=/var/lib/grafana
- GF_SECURITY_ADMIN_PASSWORD=$$GF_ADMIN_PASSWORD
- GF_SECURITY_ADMIN_USER=$$GF_ADMIN_USER
- GF_USERS_ALLOW_SIGN_UP=false
- GF_USERS_AUTO_ASSIGN_ORG_ROLE=Viewer
- GF_USERS_AUTO_ASSIGN_ORG=true
- GF_USERS_AUTO_ASSIGN_ROLE=Viewer
- GF_USERS_DEFAULT_THEME=light
- GF_USERS_VIEWERS_CAN_EDIT=true
- GF_USERS_VIEWERS_CAN_SAVE_DASHBOARDS=true
- GF_USERS_VIEWERS_CAN_SAVE_TEMPORARY=true
- INFLUXDB_USERNAME=$$INFLUXDB_USERNAME
- INFLUXDB_PASSWORD=$$INFLUXDB_PASSWORD
# Configure Grafana with the same user and password set below.
- GF_DATABASE_USER=$$GRAFANA_MYSQL_DATABASE_USERNAME
- GF_DATABASE_PASSWORD=$$GRAFANA_MYSQL_DATABASE_PASSWORD
ports:
- '0.0.0.0:3000:3000'
restart: unless-stopped
healthcheck:
test: >
curl -sL http://localhost:3000
interval: 3s
retries: 10
start_period: 5s
timeout: 5s
user: '0'
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 1G
influxdb:
image: influxdb:2.7.6
container_name: influxdb
volumes:
- influxdb-data:/data
environment:
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=$$INFLUXDB_TOKEN
#- DOCKER_INFLUXDB_INIT_RETENTION=1w
- DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=$$INFLUXDB_USERNAME
- DOCKER_INFLUXDB_INIT_PASSWORD=$$INFLUXDB_PASSWORD
- DOCKER_INFLUXDB_INIT_ORG=orchidarium
- DOCKER_INFLUXDB_INIT_BUCKET=orchidarium
ports:
- '127.0.0.1:8086:8086'
restart: unless-stopped
healthcheck:
test: influx ping || exit 1
interval: 3s
retries: 10
start_period: 5s
timeout: 5s
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 1G
mysql:
image: mysql:9.5
container_name: mysql
volumes:
- mysql-data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=$$GRAFANA_MYSQL_DATABASE_PASSWORD
- MYSQL_DATABASE=orchidarium
- MYSQL_USER=$$GRAFANA_MYSQL_DATABASE_USERNAME
- MYSQL_PASSWORD=$$GRAFANA_MYSQL_DATABASE_PASSWORD
ports:
- '127.0.0.1:3306:3306'
restart: unless-stopped
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
orchidarium:
build:
context: .
dockerfile: ./Dockerfile
target: develop
pull: true
container_name: orchidarium
depends_on:
grafana:
condition: service_started
influxdb:
condition: service_healthy
# Provide access to the USB sensors and mount a small healthcheck cache.
volumes:
# udev on /dev/humidity type devtmpfs (ro,nosuid,relatime,size=32847200k,nr_inodes=8211800,mode=755,inode64)
# udev on /dev/soil type devtmpfs (ro,nosuid,relatime,size=32847200k,nr_inodes=8211800,mode=755,inode64)
# tmpfs on /opt/orchidarium/healthcheck type tmpfs (rw,relatime,size=10240k,uid=10001,inode64)
# udev on /dev/bus/usb type devtmpfs (ro,nosuid,relatime,size=32847200k,nr_inodes=8211800,mode=755,inode64)
- /dev/bus/usb:/dev/bus/usb:ro
- /dev/humidity:/dev/humidity:ro
- /dev/soil:/dev/soil:ro
- cache:/opt/orchidarium/healthcheck
environment:
- INFLUXDB_HOST=influxdb:8086
- INFLUXDB_TOKEN=$$INFLUXDB_TOKEN
- INFLUXDB_ORG=orchidarium
- INFLUXDB_DATABASE=orchidarium
- HEALTHCHECK_PORT=8085
# - HEALTHCHECK_CACHE_TTL=60
- HEALTHCHECK_CACHE_PATH=/opt/orchidarium/healthcheck
- DEBUG=true
ports:
# Healthcheck is served on port 8085 on localhost.
- '127.0.0.1:8085:8085'
restart: unless-stopped
healthcheck:
test: >
curl -sL http://localhost:8085/health && curl -sL http://localhost:8085/ready
start_period: 5s
interval: 30s
timeout: 5s
retries: 3
user: '10001'
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '1.0'
memory: 1G
platform: linux/amd64
privileged: true
read_only: true
volumes:
mysql-data:
driver: local
driver_opts:
o: "size=500m,uid=0"
device: tmpfs
type: tmpfs
influxdb-data:
driver: local
driver_opts:
o: "size=10g,uid=0"
device: tmpfs
type: tmpfs
cache:
driver: local
driver_opts:
o: "size=10m,uid=10001"
device: tmpfs
type: tmpfs