node

时间:2022-05-21 17:45:00

docker run -d --name data -v c:/jayruanwork/app:/usr/share/app busybox || windows c:\jayruanwork\app|config
docker run -d --name=nginx -p 90:90 -p 80:80 -p 60:60 -p 70:70 --volumes-from=data -v c:/jayruanwork/config/nginx:/etc/nginx/conf.d jianyeruan/nginx
docker run -d --volumes-from=data --name mongo -p 27017:27017 jianyeruan/mongo /run.sh mongod --port 27017 --dbpath /data

chmod a+x /b.sh         --link some-mongo:mongo
c:\jayruanwork\app == /home/jayruanwork/app || c:\jayruanwork\config\nginx == /home/jayruanwork/config/nginx

docker exec -it mongo sh -c 'exec mongo --port 27019'  

  link lps-mongodb:mongo

--restart=always 自己重启。
1,docker run -d --name data -v c:\jayruanwork\app:/usr/share/app busybox
   docker run -d --name data -v /home/jayruanwork/app:/usr/share/app busybox

2,docker run -it --volumes-from=data --name mongo -p 27017:27017 jianyeruan/mongo /run.sh mongod --port 27017 --dbpath /data

3, docker run -it --volumes-from=data --name=nodejs -p 3001:3001 -e APPPATH="test2016" jaynode /run.sh supervisor app.js

docker run -it --volumes-from=data --name=nodejs -p 3001:3001 --link mongo:mongo -e APPPATH="jaynode" jaynode /run.sh supervisor app.js

4,docker run -d --name=nginx -p 80:80 -p 90:90 --volumes-from=data -v c:\jayruanwork\config\nginx:/etc/nginx/conf.d nginx

docker run -d --name=nginx -p 80:80 -p 90:90 --volumes-from=data -v /home/jayruanwork/config/nginx:/etc/nginx/conf.d nginx

docker run -d --name=nginx -p 80:80 -p 90:90 --volumes-from=data -v /home/jayruanwork/config/nginx:/etc/nginx/conf.d nginx

 -v    /home/jayruanwork/log/nginx/                       /var/log/nginx/

docker run -d --name=nginx -p 80:80 -p 90:90 -p 70:70 -p 60:60 --volumes-from=data -v c:\jayruanwork\config\nginx:/etc/nginx/conf.d nginx

5:backup | restorage

docker exec mongo mongodump --port=27019 -d testdb -o /usr/share/jayruanwork/mongo -u admin -p=123456 --authenticationDatabase admin
mongoexport --port=27019 -d testdb -c test -o students.dat -u admin -p=mypass --authenticationDatabase admin
mongorestore --port=27019 -d testdb /usr/share/jayruanwork/mongo/testdb -u admin -p=mypass --authenticationDatabase admin
mongoimport --port=27019 -d testdb -c students students.dat -u admin -p=mypass --authenticationDatabase admin

 

mongodump --port=27019 -d testdb -o /usr/share/app/mongo -u admin -p=123456 --authenticationDatabase admin
mongorestore --port=27019 -d test5201 /usr/share/app/mongo/test520 -u admin -p=admin --authenticationDatabase admin

docker exec mongo mongodump --port=27019 -d rjy -o /usr/share/app/mongo -u rjy -p=rjy --authenticationDatabase admin

docker exec mongo mongorestore --port=27019 -d rjy /usr/share/app/mongo/rjy -u rjy -p=rjy --authenticationDatabase admin

mongodump --port=27019 -d testdb -o /usr/share/app/mongo -u admin -p=123456 --authenticationDatabase admin
mongorestore --port=27019 -d test5201 /usr/share/app/mongo/test520 -u admin -p=admin --authenticationDatabase admin