https://www.growthbook.io/ logo
#ask-questions
Title
# ask-questions
e

early-library-47961

04/14/2023, 6:34 AM
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

fresh-football-47124

04/14/2023, 6:40 AM
Can you access the API directly? Usually this is caused by not changing the JWT secret, or a networking issues
e

early-library-47961

04/14/2023, 6:42 AM
How can i access the API? u mean by http get ?
f

fresh-football-47124

04/14/2023, 6:42 AM
just open that url in red in your browser
e

early-library-47961

04/14/2023, 6:44 AM
no, refused to connect
f

fresh-football-47124

04/14/2023, 6:52 AM
is there anything in the console for that page?
e

early-library-47961

04/14/2023, 6:54 AM
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

fresh-football-47124

04/14/2023, 6:55 AM
no, our system works perfectly fine on custom ports
and urls
can you share your docker-compose file?
e

early-library-47961

04/14/2023, 6:58 AM
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

fresh-football-47124

04/14/2023, 7:00 AM
that looks right
there seems to be some problem opening up port 3100
can you confirm that the docker container is running correctly?
e

early-library-47961

04/14/2023, 7:02 AM
[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

fresh-football-47124

04/14/2023, 7:06 AM
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

early-library-47961

04/14/2023, 7:15 AM
it worked!
f

fresh-football-47124

04/14/2023, 7:16 AM
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
10 Views