Devenv: Fix integration of postgres and fake-data-gen containers (#20329)

* Fix integration of postgres and fake-data-gen containers

This fix introduces the following modifications:
- Upgrades to 2.1 docker-compose file format
- Adds a health check for determining that postgrestest service is healthy
- Modifies the fake-postgres-data service to wait for postgrestest to be
"healthy" before starting.
- Renames postgrestest to postgres
pull/20441/head
Sofia Papagiannaki 6 years ago committed by GitHub
parent 886bad2fd5
commit 85b7ddefc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      devenv/docker/blocks/postgres/docker-compose.yaml
  2. 2
      devenv/docker/compose_header.yml

@ -1,4 +1,4 @@
postgrestest:
postgres:
image: postgres:${postgres_version}
environment:
POSTGRES_USER: grafana
@ -7,6 +7,11 @@
ports:
- "5432:5432"
command: postgres -c log_connections=on -c logging_collector=on -c log_destination=stderr -c log_directory=/var/log/postgresql
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "$$POSTGRES_DATABASE", "-U", "$$POSTGRES_USER" ]
timeout: 45s
interval: 10s
retries: 10
fake-postgres-data:
image: grafana/fake-data-gen
@ -14,3 +19,6 @@
environment:
FD_DATASOURCE: postgres
FD_PORT: 5432
depends_on:
postgres:
condition: service_healthy

@ -1,2 +1,2 @@
version: "2"
version: "2.1"
services:

Loading…
Cancel
Save