github.com/openfga/openfga@v1.5.4-rc1/docker-compose.yaml (about)

     1  services:
     2    postgres:
     3      image: postgres:14
     4      container_name: postgres
     5      command: postgres -c 'max_connections=100'
     6      networks:
     7        - default
     8      ports:
     9        - "5432:5432"
    10      environment:
    11        - POSTGRES_USER=postgres
    12        - POSTGRES_PASSWORD=password
    13      healthcheck:
    14        test: ["CMD-SHELL", "pg_isready -U postgres"]
    15        interval: 5s
    16        timeout: 5s
    17        retries: 5
    18  
    19    migrate:
    20      depends_on:
    21        postgres:
    22          condition: service_healthy
    23      image: openfga/openfga:latest
    24      container_name: migrate
    25      environment:
    26        - OPENFGA_DATASTORE_ENGINE=postgres
    27        - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
    28      command: migrate
    29      networks:
    30        - default
    31  
    32    openfga:
    33      depends_on:
    34        migrate:
    35          condition: service_completed_successfully
    36      image: openfga/openfga:latest
    37      container_name: openfga
    38      command: run
    39      environment:
    40        - OPENFGA_DATASTORE_ENGINE=postgres
    41        - OPENFGA_DATASTORE_URI=postgres://postgres:password@postgres:5432/postgres?sslmode=disable
    42        - OPENFGA_DATASTORE_MAX_OPEN_CONNS=100 #see postgres container
    43        - OPENFGA_PLAYGROUND_ENABLED=true
    44      networks:
    45        - default
    46      ports:
    47        - "8080:8080" #http
    48        - "8081:8081" #grpc
    49        - "3000:3000" #playground
    50        - "2112:2112" #prometheus metrics
    51      healthcheck:
    52        test: ["CMD", "/usr/local/bin/grpc_health_probe", "-addr=openfga:8081"]
    53        interval: 5s
    54        timeout: 30s
    55        retries: 3