Skip to content

Instantly share code, notes, and snippets.

@JunHao00
Last active March 26, 2025 02:18
Show Gist options
  • Select an option

  • Save JunHao00/870f2df56f260d66327921a863ac216c to your computer and use it in GitHub Desktop.

Select an option

Save JunHao00/870f2df56f260d66327921a863ac216c to your computer and use it in GitHub Desktop.
How to run my Resume Chatbot in Docker using your own .env and resume file

🧠Generative AI Chatbot (Docker Edition)

This project is a Streamlit-based chatbot designed to answer questions about the creator — including their background, education, technical skills, and more. It's powered by OpenAI and packaged as a Docker container for easy sharing and deployment.


📝 About the Project

  • Built using: Python, Streamlit, LangChain, and OpenAI API
  • Containerized for ease of use and portability
  • Hosted on Docker Hub: junhaoo/cv-chatbot

🚀 Getting Started (No Cloning Needed)

You don’t need to clone or edit the source code. Just pull the container from Docker Hub and run it!


✅ Prerequisites

Make sure you have the following installed:


⚙️ Setup

Before running the chatbot, you need to create a .env file in your current directory. This file is not included in the image, so you must manually create it and add your OpenAI API key. The format should be:

OPENAI_API_KEY=your_openai_api_key_here

You can get your API key from: https://platform.openai.com/account/api-keys

Optionally, you can also customize the chatbot’s knowledge base. By default, the chatbot uses Jun Hao’s resume stored in data.txt. If you want it to respond using your own background or information, create a new text file (e.g., my_resume.txt), write your own content in it, and mount it when running the container.

🐳 Running the Chatbot with Docker

To run the chatbot using Docker, you have two options:

If you want to use the default resume built into the image, make sure your .env file is ready in your current folder and run the following command:

docker run -p 8501:8501 --env-file .env junhaoo/cv-chatbot:v3

If you want to use your own resume file instead of the default, place your custom text file (e.g., my_resume.txt) in the current directory, and run:

docker run -p 8501:8501 --env-file .env -v $(pwd)/my_resume.txt:/app/data.txt junhaoo/cv-chatbot:v3

Once the container is running, open your browser and go to http://localhost:8501 to start chatting with the bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment