From within the root directory, execute the following commands
docker build -t hackernews:latest .
docker run --name hackernews -d hackernews
- ssh into the container.
docker exec -it hackernews bash
- To run tests, from within the /Hackernews directory execute commad
python -m unittest test_hackernews.py -v
- To run the application, from anywhere in the container, execute command
hackernews --posts n
where n is an integer in the range 0-100. - To display help message, execute
hackernews --help
These are the main libraries used. Some of them have dependencies which can be seen in requirements.txt
- beautifulsoup4: For parsing/extracting content from html.
- requests: For making HTTP requests
- rfc3986: For validating URI's
- json: For parsing python dictionaires/lists into JSON and vice-versa
- argparse: For handling user input through the command line and displaying usage information.
- logging: For displaying log messages during run time