2
我有它的数据库中泊坞窗的Web应用程序,我已经设置了:数据库中泊坞窗应用
-v /home/stephane/dev/php/learnintouch/docker/mysql/data:/usr/bin/mysql/install/data
它工作正常,但我不知道这是否是去的推荐方式。
因为我看我们也可以通过在主机上给人一种名称,而不是一个绝对路径创建一个名为卷:
-v learnintouch-data:/usr/bin/mysql/install/data
但后来,我怎么能卷名learnintouch数据与主机关联位置在/home/stephane/dev/php/learnintouch/docker/mysql/data
?
这是我目前的docker-compose.yml
文件:
learnintouch.com-startup:
image: stephaneeybert/learnintouch.com-startup
container_name: learnintouch.com-startup
ports:
- "80:80"
links:
- mysql
- redis
- nodejs-learnintouch
nodejs-learnintouch:
image: stephaneeybert/nodejs-learnintouch
container_name: nodejs-learnintouch
ports:
- "9001:9001"
links:
- redis
mysql:
image: stephaneeybert/mysql:5.6.30
container_name: mysql
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
volumes:
- "/home/stephane/dev/php/learnintouch/docker/mysql/data:/usr/bin/mysql/install/data"
redis:
image: stephaneeybert/redis:3.0.7
container_name: redis
ports:
- "6379:6379"