-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f09d3e7
commit 8678d9c
Showing
1 changed file
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,33 @@ | ||
FROM python:3.10 | ||
|
||
RUN apt-get update && apt-get install -y git git-lfs && git lfs install | ||
RUN git clone https://github.com/raphaelsty/knowledge . | ||
RUN git lfs install && git lfs pull | ||
# Install dependencies | ||
RUN apt-get update && apt-get install -y git git-lfs | ||
|
||
# Set up Git LFS | ||
RUN git lfs install | ||
|
||
# Clone the repository | ||
RUN git clone https://github.com/raphaelsty/knowledge /knowledge | ||
|
||
# Pull LFS files | ||
WORKDIR /knowledge | ||
RUN git lfs pull | ||
|
||
WORKDIR /code | ||
|
||
# Copy the necessary files | ||
COPY knowledge/database/pipeline.pkl /code/database/pipeline.pkl | ||
COPY requirements.txt /code/requirements.txt | ||
COPY setup.py /code/setup.py | ||
COPY knowledge_database /code/knowledge_database | ||
COPY api /code/api | ||
|
||
# Install Python dependencies | ||
RUN pip install pip --upgrade | ||
RUN pip install --no-cache-dir . | ||
|
||
# Set up the secret environment variable for OpenAI API Key | ||
RUN --mount=type=secret,id=OPENAI_API_KEY sh -c 'echo "export OPENAI_API_KEY=$(cat /run/secrets/OPENAI_API_KEY)" >> /etc/profile.d/openai.sh' | ||
|
||
# Set the command to run the application | ||
CMD ["/bin/bash", "-c", "source /etc/profile && uvicorn api.api:app --host 0.0.0.0 --port 8080"] |