Reduce size of Docker image and build it from local code

- Improvements
  - Install Khoj on Docker from local code instead of pulling from Github
  - Reduce Khoj Docker image size by 2Gb by not caching installed pip packages. Refer [issue comment](https://github.com/khoj-ai/khoj/issues/148#issuecomment-1627443570)
This commit is contained in:
Debanjum 2023-07-11 01:30:06 -07:00 committed by GitHub
commit 83ed8561ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,9 +6,10 @@ LABEL org.opencontainers.image.source https://github.com/khoj-ai/khoj
RUN apt update -y && \
apt -y install python3-pip python3-pyqt6 git
# Install Python Dependencies
RUN pip install --upgrade pip && \
pip install git+https://github.com/khoj-ai/khoj.git
# Install Application
COPY . .
RUN sed -i 's/dynamic = \["version"\]/version = "0.0.0"/' pyproject.toml && \
pip install --no-cache-dir .
# Run the Application
# There are more arguments required for the application to run,