Hi all, I want to deploy growthbook on a server, a...
# ask-questions
e
Hi all, I want to deploy growthbook on a server, and I have modified the docker-compose.yml, both the API_ORIGIN and API_HOST,but it failed. Anyone can help me?
f
Can you access the API directly? Usually this is caused by not changing the JWT secret, or a networking issues
e
How can i access the API? u mean by http get ?
f
just open that url in red in your browser
e
no, refused to connect
f
is there anything in the console for that page?
e
no, page is just like that 1. I found port 3100 is in use 2. I grep keyword “localhost” in the directory, should i modify more files?
f
no, our system works perfectly fine on custom ports
and urls
can you share your docker-compose file?
e
Copy code
$ cat docker-compose.yml
version: "3"
services:
  mongo:
    image: "mongo:latest"
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=password
  growthbook:
    image: "growthbook/growthbook:latest"
    ports:
      - "3000:3000"
      - "3100:3100"
    depends_on:
      - mongo
    environment:
      - MONGODB_URI=<mongodb://root:password@mongo:27017/>
      - APP_ORIGIN=<http://10.82.49.17:3000>
      - API_HOST=<http://10.82.49.17:3100>
    volumes:
      - uploads:/usr/local/src/app/packages/back-end/uploads
volumes:
  uploads:
f
that looks right
there seems to be some problem opening up port 3100
can you confirm that the docker container is running correctly?
e
[rowthbook]$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0ee710ef5d28 460d1ba0de0c “bash” 42 minutes ago Up 42 minutes 50053/tcp gifted_robinson ae7c5f8dd5bc growthbook/growthbook:latest “yarn start” 57 minutes ago Up 57 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp, 0.0.0.0:3100->3100/tcp, :::3100->3100/tcp growthbook_growthbook_1 986d8a230146 mongo:latest “docker-entrypoint.s…” 57 minutes ago Up 57 minutes 27017/tcp growthbook_mongo_1
f
You can try adding the following to the growthbook -> environment settings: - JWT_SECRET=<some string> - ENCRYPTION_KEY=<some other long string>
👍 1
in the docker compose yml file
e
it worked!
f
nice, ya, if you had looked in the docker logs you would have seen it complaining about the JWT secret not being changed when running not on localhost