Skip to content

hiyali/node-mongodb-dockerize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nodejs + Phantomjs Crawler on Mongodb dockerization

Download & Build

mkdir -p /hunt/db
git clone https://github.com/hiyali/node-mongodb-dockerize.git
docker build -q -t hunt_crawler:v1 crawler-docker/ # remove -q with outputs

Run background

docker run -d --restart always -v /hunt/db:/hunt/db:rw --add-host localhost:172.17.0.2 -p 5555:5555 -p 5556:80 --name crawler_container hunt_crawler:v1 /bin/bash -c "/hunt/run.sh"

Run foreground

docker run -i -t -v /hunt/db:/hunt/db:rw --add-host localhost:172.17.0.2 -p 5555:5555 -p 5556:80 --name crawler_runner_1 hunt_crawler:v1 /bin/bash
./run.sh

Start docker service & Start & Attach ...

systemctl start docker
docker start crawler_runner_1
docker attach crawler_runner_1

To stop a container, use CTRL-c. This key sequence sends SIGKILL to the container. If --sig-proxy is true (the default),CTRL-c sends a SIGINT to the container. You can detach from a container and leave it running using the CTRL-p CTRL-q key sequence

docker basic command

stop & remove all container

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

show & remove images

docker images
docker rmi <image id> # remove a image
docker rmi $(docker images | grep "^<none>" | awk -F ' ' '{print $3}') # remove all none named images
docker rmi $(docker images -q) # remove all images

cp file from container

docker cp <containerId>:/file/path/within/container /host/path/target

command officially documentation

docker docs

design

Crawler design

About

🐳 Dockerized repo of a Nodejs + MongoDB crawler (https://github.com/hiyali/node-crawler-on-mongodb) for daily job.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages