version: '3.6' services: postgres: environment: - POSTGRES_DB=${POSTGRES_DB:-postgres} - POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres} - POSTGRES_USER=${POSTGRES_USER:-postgres} labels: - SERVICE_5432_CHECK_TCP=true - SERVICE_5432_NAME=${COMPOSE_SERVICE_NAME}-postgres-5432 networks: - private ports: - 5432 volumes: - postgres:/var/lib/postgresql/data restart: always volumes: postgres: