version: '3.8' networks: openfga: services: db: image: postgres:14 networks: - openfga environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=password - POSTGRES_DB=openfga healthcheck: test: [ "CMD-SHELL", "pg_isready -U postgres" ] interval: 5s timeout: 5s retries: 5 pause: image: ubuntu command: sleep 5 depends_on: db: condition: service_started migrate: image: openfga/openfga depends_on: pause: condition: service_completed_successfully command: | migrate environment: - OPENFGA_DATASTORE_ENGINE=postgres - OPENFGA_DATASTORE_URI=postgres://postgres:password@db:5432/openfga networks: - openfga openfga: image: openfga/openfga environment: - OPENFGA_DATASTORE_ENGINE=postgres - OPENFGA_DATASTORE_URI=postgres://postgres:password@db:5432/openfga - OPENFGA_LOG_FORMAT=json command: run depends_on: db: condition: service_started migrate: condition: service_completed_successfully networks: - openfga ports: # Needed for the http server - "8080:8080" # Needed for the grpc server (if used) - "8081:8081" # Needed for the playground (Do not enable in prod!) - "3000:3000"