SimplyStaking / panic

PANIC Monitoring and Alerting For Blockchains
Apache License 2.0
85 stars 31 forks source link

db persistence #379

Closed colossus-digital closed 1 year ago

colossus-digital commented 2 years ago

hi, is there a way to make the db persistent ? Every time i stop and restart the containers, all config/data are gone.

Am I doing something wrong?

start : docker-compose up -d --build (I need the build flag every time ? ) stop: docker-compose down

is there something to configure that i am missing (into the .env or the docker-compose.yml files)?

dillu24 commented 2 years ago

Hey @colossus-digital I suggest that you run the containers using docker-compose up -d after you build for the first time.

To take down the container you can use docker-compose kill

colossus-digital commented 2 years ago

tnks, you are right, docker-compose stop or kill is the way to go instead of down but is there a way to make the db's volume persistent? I can see an empty volumes setting at the bottom of the docker-compose.yml. Could it somehow be used for this purpose?

volumes:
  db-data:
dillu24 commented 2 years ago

Yeah it was for that purpose. In fact if you compare the current docker-compose.yml file with the previous version you could see that db-data was used in the mongo service which is something we missed for the current release.

You could try out something similar, but I am not sure wether it would work because it may need further investigation due to the use of replica sets now.

colossus-digital commented 2 years ago

got it, tnks As an alternative (temporary), a backup/restore instructions might be helpful I don't want to risk losing all the settings. They take time to set everything

dillu24 commented 1 year ago

Replica of #376