Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: uv python install 3.10

- name: install python packages
run: uv pip install --system .
run: uv sync

- name: track large files
run: git lfs track "database/pipeline.pkl"
Expand All @@ -40,7 +40,7 @@ jobs:
ZOTERO_API_KEY: ${{ secrets.ZOTERO_API_KEY }}
ZOTERO_LIBRARY_ID: ${{ secrets.ZOTERO_LIBRARY_ID }}
HUGGINGFACE_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN }}
run: python run.py
run: uv run python run.py

- name: commit files
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flyio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Deploy app
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
lfs: true
- uses: superfly/flyctl-actions/setup-flyctl@master
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ FROM python:3.10-slim
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Clone the repository
WORKDIR /code

# Copy the necessary files
COPY database/pipeline.pkl /code/database/pipeline.pkl
COPY pyproject.toml /code/pyproject.toml
COPY readme.md /code/readme.md
COPY database/pipeline.pkl /code/database/pipeline.pkl
COPY knowledge_database /code/knowledge_database
COPY api /code/api

# Install Python dependencies using uv
RUN uv pip install --system .
# Install Python dependencies using uv with a virtual environment
RUN uv venv /code/.venv && uv pip install --python /code/.venv/bin/python .

# 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"]
CMD ["/bin/bash", "-c", "source /etc/profile && /code/.venv/bin/uvicorn api.api:app --host 0.0.0.0 --port 8080"]