I have a fig
setup that is so inconsistent that is driving me nuts. At random times between stopping services and restarting it loses the mysql data that was created. I tried with data only containers and linking them with volumes_from
and even setting the volumes
directive. Last night my computer froze and I had to issues a restart only to find out that all my mysql data was lost when issuing a fig up
command.
I really like the idea of orchestrating things up and not having to install local services such as mysql or elasticsearch locally but this inability to maintain a persistent database is quite irritating.
I updated both docker and fig to latest versions without any kind of success. Here's my fig config, maybe someone can spot something I'm doing wrong:
redis:
image: redis:latest
volumes:
- /var/devcasts/data/redis:/data
mysql:
image: mysql:latest
ports:
- 3306
environment:
MYSQL_DATABASE: mydb
MYSQL_ROOT_PASSWORD: ********
volumes:
- ./dbbackup:/dbbackup
- /var/devcasts/data/mysql:/var/lib/mysql
elasticsearch:
image: dockerfile/elasticsearch
volumes:
- /var/devcasts/data/elasticsearch:/data
web:
build: .
command: ./start.sh
environment:
DEBUG: 1
volumes:
- .:/code
ports:
- "8000:8000"
links:
- mysql
- redis
- elasticsearch
I'm using a mac with boot2docker
by the way but I think I had this problem when trying inside a vagrant ubuntu as well.