chirpstack / chirpstack-docker

Setup ChirpStack using Docker Compose
https://www.chirpstack.io/
MIT License
273 stars 316 forks source link

How can I connect pgadmin 4 to postgresql container, please help me? and can I store all sensor data to postgresql database? #89

Closed khoa21214475 closed 11 months ago

khoa21214475 commented 1 year ago

### docker-compose.yml

version: "3"

services: chirpstack: image: chirpstack/chirpstack:4 command: -c /etc/chirpstack restart: unless-stopped volumes:

volumes: postgresqldata: redisdata:

And in file "chirpstack.toml": dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable"

Error:

"Role "chirpstack" does not exist." "password authentication failed for user "chirpstack" "Connection matched pg_hba.conf line 100: "host all all all scram-sha-256"

trivialkettle commented 11 months ago

I tried the default docker-compose.yml file from this repository and added

ports:
 - 2222:5432

to postgres (as you did)

after starting docker compose up I could connect with psql

psql -h localhost -p 2222 -U chirpstack (default password: chirpstack)

Please check you docker compose logs for this lines after a clean startup:

chirpstack-docker-postgres-1                                |  done
chirpstack-docker-postgres-1                                | server started
chirpstack-docker-postgres-1                                | 
chirpstack-docker-postgres-1                                | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/001-init-chirpstack.sh
chirpstack-docker-postgres-1                                | 
chirpstack-docker-postgres-1                                | CREATE ROLE
chirpstack-docker-postgres-1                                | CREATE DATABASE
chirpstack-docker-postgres-1                                | 
chirpstack-docker-postgres-1                                | 
chirpstack-docker-postgres-1                                | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/002-chirpstack_extensions.sh
chirpstack-docker-postgres-1                                | CREATE EXTENSION
chirpstack-docker-postgres-1                                | CREATE EXTENSION
chirpstack-docker-postgres-1                                | 
chirpstack-docker-postgres-1                                |