VBoxManage modifyvm "default" --natpf1 "tcp-port90,tcp,,90,,90"
VBoxManage modifyvm "default" --natpf1 "tcp-port91,tcp,,91,,91"
VBoxManage modifyvm "default" --natpf1 "tcp-port80,tcp,,80,,80"
VBoxManage modifyvm "default" --natpf1 "tcp-port3000,tcp,,3002,,3002"
VBoxManage modifyvm "default" --natpf1 "tcp-port3001,tcp,,3002,,3002"
VBoxManage modifyvm "default" --natpf1 "tcp-port3002,tcp,,3002,,3002"
docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
sudo mount -t cifs -o username=jianyeruan,password="123" //192.168.1.5/jayruanwork /home/docker //他们有app,config cd / sudo -umount /home/docker
sudo mount -t cifs -o username=menusifu2015,password="123456" //192.168.1.125/jayruanwork /home/docker
1,开发测试时 不用link
docker run -d --name data -v /home/docker/app:/usr/share/jayruanwork centos
2,
docker run -d --volumes-from=data --name mongo -p 22017:22017 mongo
docker run -d --volumes-from=data --name mongo -p 22017:22017 -e MONGODB_PASS="123456" jianyeruan/mongo
docker run -d --volumes-from=data --name mariadb -e -p 3306:3306 MYSQL_ROOT_PASSWORD=123456 jianyeruan/mariadb
3,
docker run -d --volumes-from=data --name php7-fpm -p 9000:9000 php:7-fpm
docker run -d --volumes-from=data --name=nodejs -p 3001:3001 jianyeruan/node supervisor vip/app.js
4,nginx
docker run -d --name=nginx -p 80:80 --volumes-from=data -v /home/docker/config/nginx:/etc/nginx/conf.d nginx
备份
docker exec mongo mongodump -d testdb -o /usr/share/jayruanwork/mongo -u admin -p=123456 --authenticationDatabase admin
mongoexport -d testdb -c test -o students.dat -u admin -p=mypass --authenticationDatabase admin
还原
docker exec mongo mongorestore -d testdb /usr/share/jayruanwork/mongo/testdb -u admin -p=mypass --authenticationDatabase admin
mongoimport -d testdb -c students students.dat -u admin -p=mypass --authenticationDatabase admin
正式上线时:link 然后不用映射端口。
--link mongo:mongo --link php7-fpm:fpm --link mariadb:mariadb
程序里的location或127.0.0.1 用:后面代替.
nginx link php ;php link 数据库
nginx link node[失败还没有找到原因]; node link 数据库
node=>add supervisor,php-7fpm,nginx=>加了gzip,mongo=>auth,mariadb