Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 991 Bytes

README.md

File metadata and controls

59 lines (39 loc) · 991 Bytes

Server

Prerequisite

  1. Set up elasticsearch and kibana.
docker-compose -f ./elasticsearch/docker-compose.yml up -d
  1. Create a .env file same folder as the server.py, you can use this sample
ES_HOST=elasticsearch
ES_PORT=9200
ES_INDEX=flickr-images
  1. Create flickr-images index in elasticsearch
python create_index_es.py

Local set up

  1. Install all the necessary libraries
pip install -r requirements.txt
  1. Create the necessary model artifact (if not already created)
python ../model/clip_model.py
  1. Run the server
ES_HOST=localhost uvicorn server:app --host 0.0.0.0 --port 80

Docker container set up

  1. Build the docker image, run this from parent directory
docker build -t image-search-server -f ./server/Dockerfile .
  1. Run the container
docker run --name image-search-server --network elasticsearch_default -p 80:80 image-search-server

The api can be accessed at localhost:80