Skip to content

Commit 26268a9

Browse files
Add MySQL instance to docker-compose (#1303)
* Fix flaky service account tests Sometimes, the SA tests fail with the "service account already exists" error The issue is due to the fact that Grafana sometimes 500s on SA POSTs, but the SA is actually created, so on the retry, there's a conflict This PR changes the retry process so that if we 500, we try to find the SA and "import" it before retrying * Add MySQL instance to `docker-compose` SQLite is pretty unstable. Gettings lots of `database is locked` errors which are fixed by this DB switch
1 parent 90710b3 commit 26268a9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
version: '3'
22
services:
3+
mysql:
4+
ports:
5+
- 3306:3306
6+
image: mysql:8.3
7+
environment:
8+
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-root}
9+
- MYSQL_DATABASE=${MYSQL_DATABASE:-grafana}
10+
- MYSQL_USER=${MYSQL_USER:-grafana}
11+
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-grafana}
12+
healthcheck:
13+
test: mysqladmin ping -h localhost
14+
interval: 10s
15+
retries: 10
16+
start_period: 10s
317
grafana:
18+
depends_on:
19+
mysql:
20+
condition: service_healthy
421
ports:
522
- 3000:3000
623
image: ${GRAFANA_IMAGE:-grafana/grafana}:${GRAFANA_VERSION}
724
environment:
25+
- GF_DATABASE_TYPE=mysql
26+
- GF_DATABASE_HOST=mysql
27+
- GF_DATABASE_NAME=${MYSQL_DATABASE:-grafana}
28+
- GF_DATABASE_USER=${MYSQL_USER:-grafana}
29+
- GF_DATABASE_PASSWORD=${MYSQL_PASSWORD:-grafana}
830
- GF_SERVER_ROOT_URL=${GRAFANA_URL}
931
- GF_ENTERPRISE_LICENSE_TEXT=${GF_ENTERPRISE_LICENSE_TEXT:-}
1032
- GF_SERVER_SERVE_FROM_SUB_PATH=${GF_SERVER_SERVE_FROM_SUB_PATH:-}

0 commit comments

Comments
 (0)