Extremely Popular
version: '3.8'
services: postgres: image: postgres hostname: postgres environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_USER=postgres volumes: - ./docker/postgres/data/:/var/lib/postgresql/host/ - ./docker/postgres/init/:/docker-entrypoint-initdb.d/ ports: - "6001:5432" postgres_scram: image: postgres hostname: postgres_scram environment: - POSTGRES_DB=postgres - POSTGRES_HOST_AUTH_METHOD=scram-sha-256 - POSTGRES_INITDB_ARGS=--auth-host=scram-sha-256 - POSTGRES_PASSWORD=postgres - POSTGRES_USER=postgres volumes: - ./docker/postgres_scram/data/:/var/lib/postgresql/host/ - ./docker/postgres_scram/init/:/docker-entrypoint-initdb.d/ ports: - "6002:5432" postgres_invalid_tls: image: postgres hostname: postgres_invalid_tls environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_USER=postgres volumes: - ./docker/postgres_invalid_tls/data/:/var/lib/postgresql/host/ - ./docker/postgres_invalid_tls/init/:/docker-entrypoint-initdb.d/ ports: - "6003:5432" tests: build: . depends_on: - postgres - postgres_scram - postgres_invalid_tls environment: - WAIT_HOSTS=postgres:5432,postgres_scram:5432,postgres_invalid_tls:5432 # Wait thirty seconds after database goes online # For database metadata initialization - WAIT_AFTER_HOSTS=15