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

sparse-accountant-63897

07/19/2022, 4:27 PM
As part of my GrowthBook POC, we set it up growthbook instance on a EC2 instance, with little to no modification of the
docker-compose.yml
that came with the git repo. And we defined data sources and metrics using the web UI forms. I am guessing that all the meta data is being stored in mongoDB. However, when we restarted the docker container using the following commands , I lost all the metrics, exposure and other definitions. I also lost users who registered. I am sure there is a better way to stand it up so as to persist across restarts? Any suggestion is appreciated
Copy code
docker compose down 
docker compose up
f

future-teacher-7046

07/19/2022, 4:30 PM
You want to mount a persistent volume for the MongoDB container. Or, switch to using a hosted service like MongoDB Atlas instead.
s

sparse-accountant-63897

07/19/2022, 5:12 PM
got it. can i use s3 as a persistent volume? will this work?
Copy code
depends_on:
      - mongo
    environment:
      - MONGODB_URI=<mongodb://root:password@mongo:27017/>
      - APP_ORIGIN=${APP_ORIGIN}
      - API_HOST=${API_HOST}
    volumes:
      # - uploads:/usr/local/src/app/packages/back-end/uploads
      - uploads:
          S3_BUCKET:${S3_BUCKET}
          S3_REGION:${S3_REGION}
volumes:
  uploads:
f

future-teacher-7046

07/19/2022, 5:19 PM
You can use that for file uploads, but not for MongoDB.
s

sparse-accountant-63897

07/19/2022, 5:36 PM
Okay. Thanks.
Followed your suggestion: a. Now mounted a EBS block to an EC2 instance (/data), b . Changed the docker yaml to
Copy code
volumes:
      - uploads:/data/growthbook/uploads # ebs volume that is mounted for persistent storage
However, when I restart it is not storing user/role information
We are asked to sign up again
f

future-teacher-7046

07/19/2022, 6:37 PM
There are 2 directories to persist. uploads is only for file uploads (e.g. adding screenshots of experiments). The other directory you need is on the
mongo
container and not the growthbook one. In the mongo container, data is stored at
/data/db
so that needs to be persisted
s

sparse-accountant-63897

07/19/2022, 7:00 PM
Thanks for your help.
73 Views