Persist Data for Docker Compose #54
Replies: 4 comments 6 replies
-
For heyform you can:
|
Beta Was this translation helpful? Give feedback.
-
@iMuFeng have you actually tried that? When I try it, it doesn't work at all. The server won't even start. To give more context, I haven't git cloned this repo. I literally have a folder with a docker-compose.yml file. That's it. In most cases, a self-hosted instance can be deployed with a single docker compose file. Are you expecting that the volume If it's pointing to the folder which doesn't contain the git repo, it won't run. If it's pointing to the git repo, isn't that already in the docker image? Why would pointing to those files persist the data? I'd think that in order to persist the volume, you'd have to persist the mongo container, no? |
Beta Was this translation helpful? Give feedback.
-
@iMuFeng Since the documentation doesn't live in the Github repo, I'm not able to update it for you. If you were to move it there, I'd be happy to update a README or some doc that helps people get started with self-hosting. Nonetheless, here's the solution that I tested and found to work. Add a volume to the mongo container:
This should persist data with docker compose. I was able to stop the container, start it again, and then see that the data was still persistent. |
Beta Was this translation helpful? Give feedback.
-
+1 for persisting data in the docker-compose example. I'm using Towerr which will update to the latest version of a docker image and just lost my image assets on the latest update. Sadly it also happened with the mongo-db container 😅 - luckily i only used heyform for testing |
Beta Was this translation helpful? Give feedback.
-
I have the project set up under Docker Compose following the self-hosted instructions.
From the documentation, I'm using the basic docker-compose.yml file:
Recently, I decided to update the images. I ran
docker compose pull
anddocker compose up -d
but then I realized all my data was destroyed.Then I noticed that in this docker-compose.yml file, there are no persistent volumes.
What volumes should I persist in order to make sure that my data isn't destroyed between bringing a container down and spinning it back up again?
Beta Was this translation helpful? Give feedback.
All reactions