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"