This repository contains code to containerize a Movie Recommender System API using Docker and push it to GitHub Container Registry (GHCR).
This repository is designed to facilitate running the Movie Recommender System API in various environments:
- GitHub Container Registry (GHCR): Push the Docker image to GHCR for centralized deployment and pull it back to run locally.
- Python Virtual Environment: Run the system directly in a Python virtual environment for development and testing.
- Docker Container (Local): Containerize the application for local deployment using Docker.
- Python 3.x installed
- Docker installed
- GitHub account and access to GHCR
Clone Repo, Build and Tag the Docker image and Push it to GHCR:
git clone https://github.com/manojbusam/Recommender-Container.git
cd Recommender-Container/
docker build -t movie-recommender-app .
docker tag movie-recommender-app:latest ghcr.io/manojbusam/recommender-container/recommender-system:latest
docker login ghcr.io -u <username> -p <youraccesstoken>
docker push ghcr.io/manojbusam/recommender-container/recommender-system:latestPull the Docker image from GHCR and run it locally:
docker pull ghcr.io/manojbusam/recommender-container/recommender-system:latest
docker run -d -p 5002:5000 ghcr.io/manojbusam/recommender-container/recommender-system:latestAccess the API at: http://localhost:5002/recommend?title=The%20Matrix
2a. Clone the repository:
git clone https://github.com/manojbusam/Recommender-Container.git
cd Recommender-Container2b. Setup Virtual Environment:
python3 -m venv venv
source venv/bin/activate2c. Install Dependencies:
pip3 install -r requirements.txt2d. Run the Recommender System locally:
Convert "movies.csv" into a Python file and serve through the recommendations ML model:
python3 src/recommender.pyBuild the Docker image for the Movie Recommender System API:
docker build -t movie-recommender-app .Run the Docker container locally:
docker run -d -p 5001:5000 movie-recommender-appAccess the API at: http://localhost:5001/recommend?title=The%20Matrix
