Closed alee closed 8 years ago
There should definitely be a volume mounted to where ever MongoDB stores its data for backups. I'll add one.
I tried starting the container, adding a user, stopping the container and starting again though and the user I added was still there. Maybe you are deleting the container (calling docker-compose rm deployr
instead of docker-compose stop deployr
)?
I'm just using a plain docker build
with the deployr/Dockerfile in the comses/miracle git repo. After building the docker image I run it via
docker run -t comses/deployr:devel -d -p 400:7400
and stop it via
docker stop <imageid>
Is docker-compose
using some additional configuration that I'm missing by using the plain docker
command?
I don't think docker-compose
is doing anything special. I'll try with plain docker
and see if it still works.
When I use plain docker I can stop and start the service without my data being erased.
What I did
# create and start the container
sudo docker run -d --name deployr_con -p "7400:7400" miracle_deployr
# added a user
sudo docker stop deployr_con
# logged in as the new user
sudo docker start deployr_con
> docker --version
Docker version 1.8.1, build d12ea79
Interesting. I'll test it again later when I get a chance.
# docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 7c8fca2/1.6.2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.4.2
Git commit (server): 7c8fca2/1.6.2
OS/Arch (server): linux/amd64
I can also confirm that data are persistent. Adding a data volume for the MongoDB is a good idea.
2849f0553037aa6adc73a7e29232e6af3f470dbf added a volume for MongoDB
Ok, I think this was just user error then. Must've done something wrong in my local environment.
So I just stopped the container and started it again:
docker stop <container-id>
foillowed by
docker run -d -p 7400:7400 -v /opt/miracle/external/data:/home/miracle/deployr/7.4.1/deployr/external/data/public/data comses/deployr:devel
and it wiped out the miracle API user that I'd created and prompted me to change the admin password again. So there is still definitely some kind of data wipe going on here when stopping/starting the container. This is using the Dockerfile from warmdev/deployr-docker (I haven't updated to the JDK 1.8 version you released recently but don't think that should have affected it).
I should also note that I've restarted the docker image before and had it preserve created data so.. it's definitely something strange going on, and could certainly still be some issue with the particular environment that the docker image is being run on.
Use docker start <container-id>
to start the container again. docker run
will start a new container.
Ah, that was it, thank you @warmdev ! docker ps -a
shows me the redundant docker containers I've been creating.
I noticed that when the docker instance is stopped any additional customization in the deployr datastore disappears (e.g., any newly created users, etc.). I assume the mongodb datastore used by deployr is in-memory and not persisting to disk.
Should the docker instances have a persistent data store attached?