There are three different installation methods with various levels of containerization:
- 📦 Fully containerized API and database (recommended)
- 💻 Containerized database, local python (recommended for development)
- 🤓 Fully local, not using docker at all (if you already have postgres)
- First, clone this repository and start a terminal
- Then, run the docker containers in this network, exposing the API on port 8000.
docker compose up
- Navigate to localhost:8000/recommend/1?n=5 or see the docs at localhost:8000/docs
- Install Python
- Clone this repo and
cd
to it - Build and run the database dockerfile
docker build . -f dockerfiles/pagiladb.dockerfile -t pagiladb docker run -p 5432:5432 -e POSTGRES_DB=pagila -e POSTGRES_PASSWORD=postgres pagiladb
- Install python requirements:
pip install -r requirements.txt
- Run the recommender API via the
uvicorn
python package:uvicorn film_api:app
- Navigate to localhost:8000/recommend/1?n=5. See the docs at localhost:8000/docs
- Install PostgreSQL & python
- Clone this repo and
cd
to it. - Install and generate the example database
git clone https://github.com/xzilla/pagila.git mv pagila/pagila-schema.sql pagila/1_schema.sql mv pagila/pagila-data.sql pagila/2_data.sql rm pagila/pagila-insert-data.sql pagila/README createdb -U postgres pagila psql -U postgres -d pagila -f pagila/1_schema.sql psql -U postgres -d pagila -f pagila/2_data.sql psql -U postgres -d pagila -c "CREATE extension tablefunc;"
- Install python requirements:
pip install -r requirements.txt
- Run the recommender API via the
uvicorn
python package:uvicorn film_recommender:app
- Navigate to localhost:8000/recommend/1?n=5. See the docs at localhost:8000/docs