Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker compose files to Docker Compose section in docs #2961

Open
mkurapov opened this issue Sep 11, 2024 · 2 comments · May be fixed by #3027
Open

Add docker compose files to Docker Compose section in docs #2961

mkurapov opened this issue Sep 11, 2024 · 2 comments · May be fixed by #3027
Assignees
Labels
user-doc-priority: high User doc priority is high user-docs

Comments

@mkurapov
Copy link
Contributor

Context

In the new docker compose page, we should provide sample docker compose files that integrators can get started with.

@mkurapov
Copy link
Contributor Author

@hajjimo this is a docker compose file for all services, including TB and kratos. We still need a config file for kratos (as mentioned in #2949)

name: 'my-rafiki'
services:
  rafiki-auth:
    image: ghcr.io/interledger/rafiki-auth:v1.0.0-alpha.<newest-version>
    container_name: rafiki-auth
    environment:
      AUTH_DATABASE_URL: postgresql://...
      AUTH_SERVER_URL: https://auth.myrafiki.com
      ADMIN_PORT: 3003
      AUTH_PORT: 3006
      INTROSPECTION_PORT: 3007
      INTERACTION_PORT: 3009
      COOKIE_KEY: ...
      IDENTITY_SERVER_SECRET: ...
      IDENTITY_SERVER_URL: https://idp.mysystem.com
      REDIS_URL: redis://...
      TRUST_PROXY: true
    depends_on:
      - postgres
    networks:
      - rafiki
    ports:
      - '3003:3003'
      - '3006:3006'
      - '3007:3007'
      - '3009:3009'
    restart: always

  rafiki-backend:
    image: ghcr.io/interledger/rafiki-backend:v1.0.0-alpha.<newest-version>
    container_name: rafiki-backend
    depends_on:
      - postgres
      - redis
    environment:
      AUTH_SERVER_GRANT_URL: https://auth.myrafiki.com
      AUTH_SERVER_INTROSPECTION_URL: https://auth.myrafiki.com/3007
      DATABASE_URL: postgresql://...
      ILP_ADDRESS: test.myrafiki
      ADMIN_PORT: 3001
      CONNECTOR_PORT: 3002
      OPEN_PAYMENTS_PORT: 3000
      OPEN_PAYMENTS_URL: https://myrafiki.com
      REDIS_URL: redis://...
      WALLET_ADDRESS_URL: https://myrafiki.com/rafiki-instance
      WEBHOOK_URL: https://mysystem.com/webhooks
      EXCHANGE_RATES_URL: https://mysystem.com/rates
      ILP_CONNECTOR_URL: https://ilp.myrafiki.com
      INSTANCE_NAME: 'My ASE name'
      TRUST_PROXY: true
      KEY_ID: ...
      USE_TIGERBEETLE: true
      TIGERBEETLE_CLUSTER_ID: 0
      TIGERBEETLE_REPLICA_ADDRESSES: 10.5.0.50:4342
    networks:
      - rafiki
    ports:
      - '3000:3000'
      - '3001:3001'
      - '3002:3002'
    privileged: true
    restart: always
    volumes:
      - ../temp/:/workspace/temp/

  rafiki-frontend:
    image: ghcr.io/interledger/rafiki-frontend:v1.0.0-alpha.<newest-version>
    container_name: rafiki-frontend
    depends_on:
      - rafiki-backend
    environment:
      PORT: 3005
      GRAPHQL_URL: https://myrafiki.com:3001
      OPEN_PAYMENTS_URL: https://myrafiki.com
      KRATOS_CONTAINER_PUBLIC_URL: http://kratos:4433
      KRATOS_BROWSER_PUBLIC_URL: https://admin.myrafiki.com/kratos
      KRATOS_ADMIN_URL: http://kratos:4434/admin
    networks:
      - rafiki
    restart: always
    privileged: true
    ports:
      - '3005:3005'

  tigerbeetle:
    image: ghcr.io/tigerbeetle/tigerbeetle:0.15.4
    privileged: true
    volumes:
      - tigerbeetle-data:/var/lib/tigerbeetle
    networks:
      rafiki:
        ipv4_address: 10.5.0.50
    entrypoint:
      - /bin/sh
      - -c
      - |
        set -ex
        DATA_FILE=/var/lib/tigerbeetle/cluster_0_replica_0.tigerbeetle
        set +e
        ls $$DATA_FILE
        DATA_FILE_EXISTS="$$?"
        set -e
        echo $$DATA_FILE_EXISTS
        if [ "$$DATA_FILE_EXISTS" != 0 ]; then 
          ./tigerbeetle format --cluster=0 --replica=0 --replica-count=1 $$DATA_FILE; 
        fi
        hostname -i
        ls /var/lib/tigerbeetle
        ./tigerbeetle start --addresses=0.0.0.0:4342 $$DATA_FILE

  postgres:
    image: 'postgres:16'
    container_name: postgres
    environment:
      POSTGRES_USER: ...
      POSTGRES_PASSWORD: ...
    networks:
      - rafiki
    restart: unless-stopped
    volumes:
      - pg-data:/var/lib/postgresql/data
      - ../dbinit.sql:/docker-entrypoint-initdb.d/init.sql

  redis:
    image: 'redis:7'
    restart: unless-stopped
    networks:
      - rafiki

  kratos:
    image: 'oryd/kratos:v1.2.0'
    privileged: true
    ports:
      - '4433:4433'
    volumes:
      - ../entrypoint.sh:/entrypoint.sh
      - ../identity.schema.json:/etc/config/kratos/identity.schema.json
      - ./kratos.yml:/etc/config/kratos/kratos.yml
    entrypoint: ['/entrypoint.sh']
    networks:
      - rafiki

networks:
  testnet:
    driver: bridge
    ipam:
      config:
        - subnet: 10.5.0.0/24
          gateway: 10.5.0.1

volumes:
  pg-data:
  tigerbeetle-data:

@mkurapov
Copy link
Contributor Author

Link for docker compose installation

@melissahenderson melissahenderson added the user-doc-priority: high User doc priority is high label Sep 30, 2024
@hajjimo hajjimo linked a pull request Oct 11, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user-doc-priority: high User doc priority is high user-docs
Projects
Status: Ready for Review
Status: Backlog
3 participants