MovieLens is a free movie recommendation service that contains two key datasets: ml-latest-small and personality-isf2018. Visit https://movielens.org/ to learn more about the data available. In this assignment we make use of the aforementioned datasets to create a LAMP Stack, N-tier Web Application that satisfies 6 different Use Cases. Clients are able to search and filter through movies, see which movies are most popular, segment users based on tags and ratings, have a preview panel of users help predict the rating of a "soon to be released movie" and predict traits of users who would give a high rating to a soon to be released movie.
- Clone this repo in your local directory
- Open terminal in the 'db_cw' folder
- Make sure Docker is running
- Run sudo docker-compose up
If you run into an error, it might be because one of your ports is already in use.
- If you have mySQL installed locally on your comp, it automatically uses port 3306
- Else, check if any other docker containers are running and using one of your ports (3306, 8080, 80). You can check by running command docker ps on terminal.
- Kill whatever is using the port and re-run sudo docker-compose up
To check if the 6 containers are up and running:
- Run docker ps : There should be 6 containers listed: preprocessing, db_cw_websvr_container, mysql:8.0, nadhirahrafidz98/team_11:websvr, phpmyadmin/phpmyadmin, nadhirahrafidz98/team_11:frontend
- Go to http://localhost:8080/ : You should see the login page for phpmyadmin
- Go to http://localhost:3000/ : You should see the Home Page for the Web Application
To check if the database has been set up and populated:
- Go to localhost8080
- #to phpmyadmin: username: root password: team11
- Database MovieLens should exist with 8 tables.
Reference: https://www.youtube.com/watch?v=svlcIIp-S9w&ab_channel=TechOpenS.
Compose is a tool for defining and running multi-container Docker applications. The file creates containers for the following services:
- Preprocessing
- MySQL (version 8)
- PHP-apache webserver (which is built from the Dockerfile in ./LAMPcontainer)
- phpmyadmin
- Preprocessing container runs preprocess.py which prepares the datasets in ml-latest-small before populating the tables.
- The MySQL container will not run until the preprocessing container has ran preprocess.py.
- You don't need to manually download MySQL, PHP-apache or phpmyadmin images from Docker Hub, the docker-compose file will automatically do that for you
- The PHP-apache webserver container & phpmyadmin container have been linked to the mySQL container
- The webserver's files (eg. HTML files) are located in ./LAMPcontainer/data:/var/www/html . You can see an index.html file already in there.