Skip to content

Instantly share code, notes, and snippets.

@jaygaha
Created May 29, 2024 07:55
Show Gist options
  • Save jaygaha/1600aacdedb1af5ce006d83a31565b2e to your computer and use it in GitHub Desktop.
Save jaygaha/1600aacdedb1af5ce006d83a31565b2e to your computer and use it in GitHub Desktop.
Laravel Sail (Docker) + Soketi Setup

Soketi + Laravel Sail (Docker)

Soketi defaults to app-id, app-key, and app-secret after configuring broadcasting environment variables in the.env file. To use our own values, we should define them in docker-compose.yml as follows:

soketi:
    image: "quay.io/soketi/soketi:latest-16-alpine"
    environment:
      SOKETI_DEBUG: "1"
      SOKETI_METRICS_SERVER_PORT: "9601"
      SOKETI_DEFAULT_APP_ID: "${PUSHER_APP_ID}"
      SOKETI_DEFAULT_APP_KEY: "${PUSHER_APP_KEY}"
      SOKETI_DEFAULT_APP_SECRET: "${PUSHER_APP_SECRET}"
    ports:
      - "${SOKETI_PORT:-6001}:6001"
      - "${SOKETI_METRICS_SERVER_PORT:-9601}:9601"
    networks:
      - sail

After adding these variables to the container fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment