practical-recommender-systems / moviegeek

A django website used in the book Practical Recommender Systems to illustrate how recommender algorithms can be implemented.
MIT License
901 stars 360 forks source link

Run Moviegeek as a containerized app in Docker #48

Open veekaybee opened 3 years ago

veekaybee commented 3 years ago

Hi Kim!

I recently started working through Practical Recommender Systems as part of my work at Tumblr (I'm really enjoying it so far, thank you for the book!) and realized that the install process for the app could probably be made a bit more efficient so people don't encounter system incompatibilities or errors.

Right now, there are multiple steps that the user needs to run manually, in addition to manually generating the API key through the Movie Database, to get the app up and running. There's a way the user install experience can be a bit better.

The Issue

The install process for MovieGeek involved a lot of manual moving parts that made it easy to miss a step and incur version or operating system incompatibilities, even using an isolated virtual environment. Additionally, it took over 10 minutes to install locally. Putting both the Django database and the web app into a docker-compose file that starts and runs the two services within its own Docker container will solve the issue. I also made a few other small tweaks to optimize data imports and use libraries like requests instead of urlllib to make starting up easier.

What Was Changed

How to Test the Changes

  1. Pull this branch (dockerize)
  2. Add your API key to the .prs file as before
  3. Install Docker Desktop if you don't have it yet
  4. Run docker-compose up to start the install process. Follow other instructions on the README to restart the image.
  5. Go to http://0.0.0.0:8000/ and click around in the app. It should have the same functionality as described in the book: loading all images, navigating all genres, 'buy' generates a bookmark for a movie, and the analytics module shows logging tracking events.
veekaybee commented 2 years ago

Hey @kimfalk bump on this. Wanted to make sure you saw it and had a chance to reply with any questions/concerns. Thanks!

jasonsalas commented 2 years ago

I was just about to offer a Dockerize'd PR myself, @veekaybee. Fantastic work! :)

kimfalk commented 2 years ago

He @veekaybee,

Thank you for your work, I have a dockerized version to push the master branch myself. Similar to the one in the https://github.com/kimfalk/live-project. I will push that one of these days, and then I will go through your PR.

veekaybee commented 2 years ago

Great, thanks @kimfalk!

kimfalk commented 2 years ago

Hi @veekaybee,

One of these days was a bit optimistic I guess, but now I have added the docker config. Let me know if you still think something is missing.

veekaybee commented 2 years ago

That's awesome, @kimfalk. Excited to try it out. 😄