Blog API with Django+PostgreSQL+nginx orchestrated with Docker v17.0.5 CE and docker-compose v 1.13.0
for the CKL Backend challenge.
New: Includes a crawler service that scrapes Articles, Subjects and Authors from infowars.com.
- Install Docker and docker-compose.
- Clone this repository locally.
docker-compose upin the containing folder.
If on Linux, it should be listening at http://localhost:80 .
If on docker-machine, and consequently on Windows, it will run off the docker-machine's address (usually http://192.168.99.100 ) on port
nginx is set up to proxy pass at root (
'/'), which gateways to a docker contained service host named
proxy at port
If this proxy service is not available, accessing root will return a 502 code.
Django's views (like http://localhost/api/v1/authors ) should remain accessible regardless of the front-end proxy's state.
The credentials for http://localhost/admin are reset every time the container is restarted, using the WEB_ADMIN variables in env/web.env for its credentials.
Default access credentials for the admin panel are:
- username: admin
- password: cheesecake
The crawler service scrapes after the most recent articles in each category, comparing them with articles already in Blog's PostgreSQL database, inserting them into it if not. After the initial scrape, it checks the news frontpage every 30 minutes.
The Article API (http://localhost/api/v1/articles) should offer 6 articles per page.