openfga / openfga/openfga.dev

Gap in docs (or a bug?) for non-standard docker ports and the playground

Open
#404 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51
Forks
105
Avg merge
10h 35m
Merged PRs (30d)
17

Description

So if i do a docker compose like below, the containers will all spin up and postgres is happy (at least i'm able see migrations ran and the tables are there), but when i go to the playground, I see the page, but can't do anything.

as far as i can tell it's because, when i'm creating a new store for instance, i see network call trying to POST to http://127.0.0.1:8080/stores which should really be http://127.0.0.1:6749/stores in the config below.

maybe it's a bug or maybe this just needs to be an OPENFGA_ var to pass the info in, but there's not really any guidance on how this should be handled, which seems especially problematic given the commonality of the example ports.

  postgres:
    image: postgres:14
    container_name: postgres
    networks:
      - default
    ports:
      - "3865:5432"
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=password
    healthcheck:
      test: [ "CMD-SHELL", "pg_isready -U postgres" ]
      interval: 5s
      timeout: 5s
      retries: 5

  migrate:
    depends_on:
      postgres:
        condition: service_healthy
    image: openfga/openfga:latest
    container_name: migrate
    environment:
      - OPENFGA_DATASTORE_ENGINE=postgres
      - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
    command: migrate
    networks:
      - default

  openfga:
    depends_on:
      migrate:
        condition: service_completed_successfully
      otel-collector:
        condition: service_started
    image: openfga/openfga:latest
    container_name: openfga
    command: run
    environment:
      - OPENFGA_DATASTORE_ENGINE=postgres
      - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
#      - OPENFGA_TRACE_ENABLED=true
#      - OPENFGA_TRACE_SAMPLE_RATIO=1
#      - OPENFGA_TRACE_OTLP_ENDPOINT=otel-collector:4317
#      - OPENFGA_METRICS_ENABLE_RPC_HISTOGRAMS=true
    networks:
      - default
    ports:
      - "6749:8080" #http
      - "6750:8081" #grpc
      - "6532:3000" #playground
    healthcheck:
      test: ["CMD", "/bin/grpc_health_probe", "-addr=openfga:8081"]
      interval: 5s
      timeout: 30s
      retries: 3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Docker Compose configuration and the playground's request endpoint behavior, focusing on the non-standard host port mapping for HTTP. Verify whether the playground can use the mapped port; done means either documenting the required OPENFGA_ configuration or confirming the bug and adding guidance for this setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, postgresql
Domain
devops, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.