-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose1.yml
50 lines (47 loc) · 1.17 KB
/
docker-compose1.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
---
# docker-compose up
# no quote and no {} no commas
# example of array element is
# to parse yml is slower than parsing json, because everything is string and then we need to convert it to the right type
# tags:
# - tag1
# - tag2
version: "3.8"
services:
database:
build:
context: ./mysql_tests
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: grafana_tests
MYSQL_USER: grafana
MYSQL_PASSWORD: password
ports:
- "3306:3306"
container_name: database
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-uroot", "-ppass"]
interval: 15s
timeout: 10s
retries: 5
start_period: 40s
volumes:
- mysql:/var/lib/mysql
grafana:
image: grafana/grafana:${grafana_version}
container_name: grafana
ports:
# 3000 of computer to 3000 of container
- "3000:3000"
depends_on:
database:
condition: service_healthy
environment:
GF_DATABASE_TYPE: mysql
GF_DATABASE_HOST: database:3306
GF_DATABASE_NAME: grafana_ds_tests
GF_DATABASE_USER: grafana
GF_DATABASE_PASSWORD: password
volumes:
mysql:
driver: local