SorrTask780_Simple_Chatbot_with_Redis
Created a basic conversational chatbot with Redis. It is a Flask web application connected to a Redis server. Redis here is used for caching purposes. It stores and retrieves previously generated responses for the chatbot. I have containerized the project in Docker. I have added the code for the project.
To run the code:
- Run
docker-compose up --build - Open
localhost:8000/in a web browser
To check the Redis cache:
- Once the application in running, open a new terminal and run
docker exec -it <redis container name e.g. chatbot-redis> redis-cli - After entering the redis-cli, run command
KEYS *
Link the video presentation: Video Presentation - Simple Chatbot with Redis - Swathi Baskaran
Issue: I have successfully built the container, but am facing issues with the port numbers. My app keeps running on a different port. Working on it. Edit: Solved
I had the same issue. Checkout my issue to see the solution.
By default, Flask wants to run on 127.0.0.1:5000.
In your Dockerfile and compose.yaml, you're exposing port 8000.
In app.py make this change:
# Incorrect
if __name__ == '__main__':
app.run()
# Correct
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000, debug=True)
Now it should work.
Thanks @Bodarnn! I was able to fix the port numbers and it is working now.
I have added the README file and all the necessary files for project and made the final commit.