Skip to content

Instantly share code, notes, and snippets.

@ajeetraina
Created December 26, 2023 10:43
Show Gist options
  • Save ajeetraina/53614ba8d9689ee9e524bedae18a1499 to your computer and use it in GitHub Desktop.
Save ajeetraina/53614ba8d9689ee9e524bedae18a1499 to your computer and use it in GitHub Desktop.
docker compose file for GenAI for Docker Desktop
services:
pull-model:
image: genai-stack/pull-model:latest
build:
context: .
dockerfile: pull_model.Dockerfile
environment:
- LLM=${LLM-gpt-3.5}
networks:
- net
tty: true
database:
image: neo4j:5.11
ports:
- 7687:7687
- 7474:7474
volumes:
- $PWD/data:/data
environment:
- NEO4J_AUTH=${NEO4J_USERNAME-neo4j}/${NEO4J_PASSWORD-password}
- NEO4J_PLUGINS=["apoc"]
- NEO4J_db_tx__log_rotation_retention__policy=false
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:7474 || exit 1"]
interval: 5s
timeout: 3s
retries: 5
networks:
- net
loader:
build:
context: .
dockerfile: loader.Dockerfile
volumes:
- $PWD/embedding_model:/embedding_model
environment:
- NEO4J_URI=${NEO4J_URI-neo4j://database:7687}
- NEO4J_PASSWORD=${NEO4J_PASSWORD-password}
- NEO4J_USERNAME=${NEO4J_USERNAME-neo4j}
- OPENAI_API_KEY=${OPENAI_API_KEY-}
- EMBEDDING_MODEL=${EMBEDDING_MODEL-sentence_transformer}
- LANGCHAIN_ENDPOINT=${LANGCHAIN_ENDPOINT-"https://api.smith.langchain.com"}
- LANGCHAIN_TRACING_V2=${LANGCHAIN_TRACING_V2-false}
- LANGCHAIN_PROJECT=${LANGCHAIN_PROJECT}
- LANGCHAIN_API_KEY=${LANGCHAIN_API_KEY}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
networks:
- net
depends_on:
database:
condition: service_healthy
pull-model:
condition: service_completed_successfully
x-develop:
watch:
- action: rebuild
path: .
ignore:
- bot.py
- pdf_bot.py
- api.py
- front-end/
ports:
- 8081:8080
- 8502:8502
bot:
build:
context: .
dockerfile: bot.Dockerfile
volumes:
- $PWD/embedding_model:/embedding_model
environment:
- NEO4J_URI=${NEO4J_URI-neo4j://database:7687}
- NEO4J_PASSWORD=${NEO4J_PASSWORD-password}
- NEO4J_USERNAME=${NEO4J_USERNAME-neo4j}
- OPENAI_API_KEY=${OPENAI_API_KEY-}
- LLM=${LLM-gpt-3.5}
- EMBEDDING_MODEL=${EMBEDDING_MODEL-sentence_transformer}
- LANGCHAIN_ENDPOINT=${LANGCHAIN_ENDPOINT-"https://api.smith.langchain.com"}
- LANGCHAIN_TRACING_V2=${LANGCHAIN_TRACING_V2-false}
- LANGCHAIN_PROJECT=${LANGCHAIN_PROJECT}
- LANGCHAIN_API_KEY=${LANGCHAIN_API_KEY}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
networks:
- net
depends_on:
database:
condition: service_healthy
pull-model:
condition: service_completed_successfully
x-develop:
watch:
- action: rebuild
path: .
ignore:
- loader.py
- pdf_bot.py
- api.py
- front-end/
ports:
- 8501:8501
pdf_bot:
build:
context: .
dockerfile: pdf_bot.Dockerfile
environment:
- NEO4J_URI=${NEO4J_URI-neo4j://database:7687}
- NEO4J_PASSWORD=${NEO4J_PASSWORD-password}
- NEO4J_USERNAME=${NEO4J_USERNAME-neo4j}
- OPENAI_API_KEY=${OPENAI_API_KEY-}
- LLM=${LLM-gpt-3.5}
- EMBEDDING_MODEL=${EMBEDDING_MODEL-sentence_transformer}
- LANGCHAIN_ENDPOINT=${LANGCHAIN_ENDPOINT-"https://api.smith.langchain.com"}
- LANGCHAIN_TRACING_V2=${LANGCHAIN_TRACING_V2-false}
- LANGCHAIN_PROJECT=${LANGCHAIN_PROJECT}
- LANGCHAIN_API_KEY=${LANGCHAIN_API_KEY}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
networks:
- net
depends_on:
database:
condition: service_healthy
pull-model:
condition: service_completed_successfully
x-develop:
watch:
- action: rebuild
path: .
ignore:
- loader.py
- bot.py
- api.py
- front-end/
ports:
- 8503:8503
api:
build:
context: .
dockerfile: api.Dockerfile
volumes:
- $PWD/embedding_model:/embedding_model
environment:
- NEO4J_URI=${NEO4J_URI-neo4j://database:7687}
- NEO4J_PASSWORD=${NEO4J_PASSWORD-password}
- NEO4J_USERNAME=${NEO4J_USERNAME-neo4j}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- LLM=${LLM-gpt-3.5}
- EMBEDDING_MODEL=${EMBEDDING_MODEL-sentence_transformer}
- LANGCHAIN_ENDPOINT=${LANGCHAIN_ENDPOINT-"https://api.smith.langchain.com"}
- LANGCHAIN_TRACING_V2=${LANGCHAIN_TRACING_V2-false}
- LANGCHAIN_PROJECT=${LANGCHAIN_PROJECT}
- LANGCHAIN_API_KEY=${LANGCHAIN_API_KEY}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
networks:
- net
depends_on:
database:
condition: service_healthy
pull-model:
condition: service_completed_successfully
x-develop:
watch:
- action: rebuild
path: .
ignore:
- loader.py
- bot.py
- pdf_bot.py
- front-end/
ports:
- 8504:8504
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:8504/ || exit 1"]
interval: 5s
timeout: 3s
retries: 5
front-end:
build:
context: .
dockerfile: front-end.Dockerfile
x-develop:
watch:
- action: sync
path: ./front-end
target: /app
ignore:
- ./front-end/node_modules/
- action: rebuild
path: ./front-end/package.json
depends_on:
api:
condition: service_healthy
networks:
- net
ports:
- 8505:8505
networks:
net:
@ajeetraina
Copy link
Author

docker compose ps
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_ACCESS_KEY_ID" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_SECRET_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_DEFAULT_REGION" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_ACCESS_KEY_ID" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_SECRET_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_DEFAULT_REGION" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_ACCESS_KEY_ID" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_SECRET_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_DEFAULT_REGION" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_ACCESS_KEY_ID" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_SECRET_ACCESS_KEY" variable is not set. Defaulting to a blank string."
time="2023-12-26T16:15:53+05:30" level=warning msg="The "AWS_DEFAULT_REGION" variable is not set. Defaulting to a blank string."
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
genai-stack-api-1 genai-stack-api "uvicorn api:app --h…" api About an hour ago Up About an hour (healthy) 0.0.0.0:8504->8504/tcp
genai-stack-bot-1 genai-stack-bot "streamlit run bot.p…" bot About an hour ago Up About an hour (healthy) 0.0.0.0:8501->8501/tcp
genai-stack-database-1 neo4j:5.11 "tini -g -- /startup…" database About an hour ago Up About an hour (healthy) 0.0.0.0:7474->7474/tcp, 7473/tcp, 0.0.0.0:7687->7687/tcp
genai-stack-front-end-1 genai-stack-front-end "npm run dev" front-end About an hour ago Up About an hour 0.0.0.0:8505->8505/tcp
genai-stack-loader-1 genai-stack-loader "streamlit run loade…" loader About an hour ago Up About an hour (unhealthy) 0.0.0.0:8502->8502/tcp, 0.0.0.0:8081->8080/tcp
genai-stack-pdf_bot-1 genai-stack-pdf_bot "streamlit run pdf_b…" pdf_bot About an hour ago Up About an hour (healthy) 0.0.0.0:8503->8503/tcp

@ajeetraina
Copy link
Author

image

@ajeetraina
Copy link
Author

image

@ajeetraina
Copy link
Author

image

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