Search This Blog

Showing posts with label docker. Show all posts
Showing posts with label docker. Show all posts

Monday, November 18, 2019

Move local rocketchat to production

If you have a dev environment on VSC and you want to move to production by creating docker images
please read ahead

create docker out of your meteor installation.
meteor build --server-only --directory /tmp/rc-build cp .docker/Dockerfile /tmp/rc-build cd /tmp/rc-build docker build -t someimage .

check your local meteor mongo port and take a dump.


mongodump -h 127.0.0.1 --port 3001 -d meteor  --forceTableScan  


// dbname is meteor for dev by default use the local mongodumb cli in ubuntu if not install mongo-tools.
//you will have to move this folder as a gzip file to the mongo container and do a restore.
tar -zcvf meteor.tar.gz meteor/   

docker cp meteor.tar.gz mongo:/ ----------- mongo is container name and will place gz file in the root.



mongorestore -d rocketchat dump/meteor // db name if rocketchat by default for offical images

//make sure to check db names while importing use a tool like robot3 to have mongo gui



to run the new images run below.
$ docker run --name mongo -d mongo:4.0 --smallfiles --replSet rs0 --oplogSize 128
$ docker exec -ti mongo mongo --eval "printjson(rs.initiate())"

// default rocket.chat images look for mongo container to connect to on 27017 and with name mongo.

 docker run --name rocketchat -p 80:3000 --link mongo --env ROOT_URL=http://localhost --env MONGO_OPLOG_URL=mongodb://mongo:27017/local -d someimage

//docker file for rocket.chat
https://github.com/RocketChat/Rocket.Chat/blob/develop/.docker/Dockerfile

Wednesday, September 25, 2019

Login to docker vm without password default vm

ssh -i /path to id_rsa in .docker/machine folder docker@ ip of the vm
good to have it bridged so that ip is available in host.

Log into Minikube via putty

Get the ppk file via puttygen , import the id_rsa files in minikube/machines folder and import
via the conversion tab on putty gen, save the ppk and use it on the putty ssh options.
make sure you select the SHa1-rsa(2048 bits) while saving ppk else it won't work.