- Set up
elasticsearch
andkibana
.
docker-compose -f ./elasticsearch/docker-compose.yml up -d
- Create a
.env
file same folder as theserver.py
, you can use this sample
ES_HOST=elasticsearch
ES_PORT=9200
ES_INDEX=flickr-images
- Create
flickr-images
index in elasticsearch
python create_index_es.py
- Install all the necessary libraries
pip install -r requirements.txt
- Create the necessary model artifact (if not already created)
python ../model/clip_model.py
- Run the server
ES_HOST=localhost uvicorn server:app --host 0.0.0.0 --port 80
- Build the docker image, run this from parent directory
docker build -t image-search-server -f ./server/Dockerfile .
- 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