- POSTGRES_USER=${POSTGRES_USER:-user} # Set environment variable POSTGRES_USER with default value 'user'
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} # Set environment variable POSTGRES_PASSWORD with default value 'password' (not recommended for security reasons)
volumes:
- postgres:/data/postgres # Mount named volume 'postgres' to /data/postgres in container
ports:
- "5432:5432" # Map host port 5432 to container port 5432
networks:
- postgres # Connect container to the 'postgres' network
grafana:
restart: always # Restart container automatically on failure
depends_on:
- pg_grafana # Wait for pg_grafana service to be up before starting
image: harbor.nexpie.com/flowstack/grafana:10.3.1-1 # Use specific Grafana image
# image: grafana/grafana-enterprise
environment:
- GF_FLOWSTACK_POSTGRES_ENDPOINT=${POSTGRES_ENDPOINT:-pg_grafana}:${POSTGRES_PORT:-5432} # Set Grafana database host (pg_grafana service name)
- GF_FLOWSTACK_POSTGRES_DATABASE=${POSTGRES_DB:-postgres} # Set Grafana database name (environment variable not defined)
- GF_FLOWSTACK_POSTGRES_USER=${POSTGRES_USER:-user} # Incorrect variable reference, use ${POSTGRES_USER}
- GF_FLOWSTACK_POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} # Incorrect variable reference, use ${POSTGRES_PASSWORD}
# - GF_DATABASE_SSL_MODE=disable # Disable SSL mode for database connection
ports:
- "43000:3000" # Map host port 43000 to container port 3000 (default Grafana port)
pgadmin:
container_name: pgadmin_container
image: dpage/pgadmin4
environment:
- PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org} # Set default email for pgAdmin with fallback
- PGADMIN_DEFAULT_PASSWORD=${PGADMIN_DEFAULT_PASSWORD:-admin} # Set default password for pgAdmin with fallback
- PGADMIN_CONFIG_SERVER_MODE=False # Disable server mode for pgAdmin
volumes:
- pgadmin:/var/lib/pgadmin # Mount named volume 'pgadmin' to /var/lib/pgadmin in container
ports:
- "${PGADMIN_PORT:-8888}:80" # Map host port defined by PGADMIN_PORT (default 8888) to container port 80
networks:
- postgres # Connect container to the 'postgres' network
restart: unless-stopped # Restart container only if it exits abnormally