[Unit] Description=PostgreSQL Exporter for Prometheus Wants=network-online.target After=network-online.target After=postgresql.service [Container] Image=quay.io/prometheuscommunity/postgres-exporter:v0.15.0 Environment=DATA_SOURCE_URI='postgres-exporter@:5432/postgres?host=/run/postgresql' Mount=type=bind,source=/run/postgresql,target=/run/postgresql # container_t cannot access the PostgreSQL socket postgresql_var_run_t SecurityLabelDisable=true User=221 Group=221 DropCapability=all PublishPort=9187:9187 [Install] WantedBy=multi-user.target