Hi, Im trying to self-host using MacOS arm64, but ...
# announcements
s
Hi, Im trying to self-host using MacOS arm64, but am not able to connect to the GrowthBook API (see image). Could someone please provide me with some guidance? Thank you in advance.
b
Are you using docker? Can you share the docker compose config file if you have made any local changes? What do you get when you hit GB api http://localhost:3100 directly? I'm also new to growthbook, but if you don't mind I can take a look.
Also check container logs for any errors
s
Hi, thanks for your reply. This is the docker compose config file I am using, I added `platform: "linux/amd64"`:
When I hit the api directly, I get a "Load failed" error:
Also, do you know where we can find the logs? And http://localhost:3100/ on start up is there, but becomes unresponsive.
b
a contributor ran into a similar problem. can you set the following environment variable:
Copy code
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker-compose up -d
this is the PR they provided for us to update the docs: https://github.com/growthbook/growthbook/pull/1194 did you want to test their suggestions to see if it works and let us know?
b
adding
DOCKER_DEFAULT_PLATFORM
should help as suggested above. for logs, I check the container logs using
docker container logs -f <container_name>
container name could be something like
growthbook_growthbook_1
f
connecting directly to the api (port 3100) should give you a small json object
if this is not working, its often from not setting the JWT_SECRET and ENCRYPTION_KEY when setting to production mode
s
Thanks for the help. Got it to work after adding
DOCKER_DEFAULT_PLATFORM
and using an earlier version of MongoDB 5.0+ as "MongoDB 5.0+ requires a CPU with AVX support, and your current system does not appear to have that!"
🙌 1
b
Glad to hear that @some-umbrella-45927 may I suggest you to update the docker compose file to contain platform directive at 2 places as suggested on the PR, this way related configs stay in one place.
s
@blue-hamburger-60411 This is the docker compose file that got it to run; however, having memory issues leading to "load failed" error.
Copy code
version: "3"
services:
  mongo:
    image: "mongo:4.4.6"
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=password
  growthbook:
    image: "growthbook/growthbook:latest"
    platform: "linux/amd64"
    ports:
      - "3000:3000"
      - "3100:3100"
    depends_on:
      - mongo
    environment:
      - MONGODB_URI=<mongodb://root:password@mongo:27017/>
    volumes:
      - uploads:/Users/Hajime.Alabanza/growthbook/data/
volumes:
  uploads: