Skip to content

Commit

Permalink
adding dockerfile for langchain chatwithDB
Browse files Browse the repository at this point in the history
  • Loading branch information
JAlcocerT committed Dec 8, 2024
1 parent 6b9b14e commit 39bf681
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 6 deletions.
2 changes: 1 addition & 1 deletion LangChain/ChatWithDB/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10.14-slim
FROM python:3.12.3-slim
# https://hub.docker.com/_/python

# LABEL org.opencontainers.image.source https://github.com/JAlcocerT/Data-Chat
Expand Down
56 changes: 56 additions & 0 deletions LangChain/ChatWithDB/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: "3.8"

services:
db:
image: mysql:8.0
container_name: mysql_db
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: chinook
MYSQL_USER: myuser
MYSQL_PASSWORD: mypassword
ports:
- "3306:3306" # Expose MySQL on localhost:3306
volumes:
- db_data:/var/lib/mysql # Persistent storage for database data
- ./init-scripts:/docker-entrypoint-initdb.d # Initialization scripts
command: >
bash -c "apt-get update && apt-get install -y wget &&
wget -O /docker-entrypoint-initdb.d/Chinook_MySql.sql
https://github.com/lerocha/chinook-database/releases/download/v1.4.5/Chinook_MySql.sql &&
docker-entrypoint.sh mysqld"
volumes:
db_data:

###docker exec -it mysql_db bash
###docker exec -it mysql_db mysql -u myuser -p chinook



# version: "3.8"

# services:
# db:
# image: mysql:8.0
# container_name: mysql_db
# environment:
# MYSQL_ROOT_PASSWORD: rootpassword
# MYSQL_DATABASE: mydatabase
# MYSQL_USER: myuser
# MYSQL_PASSWORD: mypassword
# ports:
# - "3306:3306" # Expose MySQL on localhost:3306
# volumes:
# - db_data:/var/lib/mysql # Persistent storage for database data

# streamlit_app:
# image: python:3.11-slim
# container_name: streamlit_app
# working_dir: /app
# volumes:
# - .:/app # Mount local directory to container
# ports:
# - "8501:8501" # Expose Streamlit on localhost:8501
# command: >
# bash -c "pip
2 changes: 2 additions & 0 deletions LangChain/ChatWithDB/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Follow any of [these Python environment setup](https://jalcocert.github.io/JAlco

For the `ipynb` vscode will ak you for the `ipykernel` module.

[![Open in Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JAlcocerT/Data-Chat/blob/main/LangChain/ChatWithDB/test_langchainChatDB.ipynb)

Then you will be asked to **select the Python env**.

You will need : https://platform.openai.com/api-keys
Expand Down
8 changes: 4 additions & 4 deletions LangChain/ChatWithDB/test_langchainChatDB.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -195,7 +195,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -814,7 +814,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "langchainChatDB_venv",
"display_name": "datachat_venv",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
* in a docker container - as a server running your local machine or in the cloud
* [ChatWithPDF Repo](https://github.com/JAlcocerT/ask-multiple-pdfs/) and Blog [Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-pdfs/)
* [ChatWithCSV Repo](https://github.com/JAlcocerT/langchain-ask-csv) and Blog [Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-your-data/#chat-with-csv-with-langchain)
* ChatWithDB Blog [Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-your-data/) - `./LangChain/ChatWithDB`
* ChatWithDB [Blog Post](https://jalcocert.github.io/JAlcocerT/how-to-chat-with-your-data/) - `./LangChain/ChatWithDB`

* [**PandasAI**](https://jalcocert.github.io/JAlcocerT/how-to-use-pandasAI/) with
* GroqAPI
Expand Down

0 comments on commit 39bf681

Please sign in to comment.