rakam-io / rakam-api

📈 Collect customer event data from your apps. (Note that this project only includes the API collector, not the visualization platform)
https://rakam.io
GNU Affero General Public License v3.0
798 stars 105 forks source link

FATAL: role "root" does not exist with Docker #110

Open chris-aeviator opened 5 years ago

chris-aeviator commented 5 years ago

When bringing up the projekt with docker-compose (with the supplied docker-compose.yml) I will get an ongoing error role "root" does not exist from postgresql. I realised that my (already perfectly running) rakam setup stopped running 1 month ago and got that error when restarting it with docker-compose restart suddenly. It is strange, since both rakam-api & rakam-db containers have the rakam user set to rakam:

docker-compose.yml

version: '2.1'
services:
  rakam-db:
    image: postgres:10.6
    volumes:
      - ./data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=rakam
      - POSTGRES_PASSWORD=dummy
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 5s
      timeout: 5s
      retries: 3
  rakam-api:
    image: buremba/rakam
    expose:
      - 9999
    environment:
      - RAKAM_CONFIG_STORE_ADAPTER_POSTGRESQL_URL=postgres://rakam:dummy@rakam-db:5432/rakam
      - RAKAM_CONFIG_LOCK__KEY=veryLongRandomString
      - LETSENCRYPT_HOST=analytics.tools.myawesomecompany.io
      - VIRTUAL_HOST=analytics.tools.myawesomecompany.io
      - LETSENCRYPT_EMAIL=chris@myawesomecompany.io

    depends_on:
      rakam-db:
        condition: service_healthy

networks:
  default:
    external:
      name: nginx-proxy

only after creating the psql user & database "root" the rakam api will start

dmaitra-pt commented 1 year ago

Initially it was FATAL: role "root" does not exist so in the postgres-local.env file I have added this PGUSER=mydbuser now I am getting error: FATAL: database "achuser" does not exist