Skip to content

Commit

Permalink
feat: add docker configurations and deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpek committed Oct 8, 2024
1 parent b234839 commit e40507b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.github/
.git/
.mypy_cache/
.theflow/
__pycache__/
ktem_app_data/
env/
Expand All @@ -11,3 +12,4 @@ env/
README.md
*.zip
*.sh
venv*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ venv/
ENV/
env.bak/
venv.bak/
venv*

# Spyder project settings
.spyderproject
Expand Down
13 changes: 3 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,9 @@ WORKDIR /app

FROM base_image as dev

COPY scripts/download_pdfjs.sh /app/scripts/download_pdfjs.sh
RUN chmod +x /app/scripts/download_pdfjs.sh

ENV PDFJS_PREBUILT_DIR="/app/libs/ktem/ktem/assets/prebuilt/pdfjs-dist"
RUN bash scripts/download_pdfjs.sh $PDFJS_PREBUILT_DIR

COPY . /app
RUN --mount=type=ssh pip install --no-cache-dir -e "libs/kotaemon[all]" \
&& pip install --no-cache-dir -e "libs/ktem" \
&& pip install --no-cache-dir graphrag future \
&& pip install --no-cache-dir "pdfservices-sdk@git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements"
RUN pip install --no-cache-dir -e "libs/kotaemon[all]" -e "libs/ktem"
RUN pip install --no-cache-dir langchain-google-genai
RUN pip install --no-cache-dir graphrag future

CMD ["python", "app.py"]
1 change: 1 addition & 0 deletions scripts/docker_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build -t ktem:1.0 --no-cache ./
6 changes: 6 additions & 0 deletions scripts/docker_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
docker run \
-e GRADIO_SERVER_NAME=0.0.0.0 \
-e GRADIO_SERVER_PORT=7860 \
-p 7860:7860 \
-it \
ktem:1.0

0 comments on commit e40507b

Please sign in to comment.