Skip to content

Commit

Permalink
feat(backend): Support standard pyproject dependencies for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Jan 12, 2025
1 parent f3aaad6 commit d03ef63
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion backend/src/interfaces/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class GetAgentSecretResponse(BaseModel):
# TODO: move the agent types in utils package once stable
class AgentPythonPackageManager(str, Enum):
poetry = "poetry"
pip = "pip"
requirements = "requirements"
pyproject = "pyproject"


class AgentUsageType(str, Enum):
Expand Down
5 changes: 3 additions & 2 deletions deployment/poetry.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG PYTHON_VERSION=3.11
ARG ENTRYPOINT="fastapi run src/main.py"
ARG PYTHON_VERSION=3.12

FROM python:${PYTHON_VERSION}-slim

ARG ENTRYPOINT="fastapi run src/main.py"

WORKDIR /app

COPY pyproject.toml poetry.lock ./
Expand Down
5 changes: 3 additions & 2 deletions deployment/pip.Dockerfile → deployment/pyproject.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG PYTHON_VERSION=3.11
ARG ENTRYPOINT="fastapi run src/main.py"
ARG PYTHON_VERSION=3.12

FROM python:${PYTHON_VERSION}-slim

ARG ENTRYPOINT="fastapi run src/main.py"

WORKDIR /app

COPY requirements.txt ./
Expand Down
17 changes: 17 additions & 0 deletions deployment/requirements.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG PYTHON_VERSION=3.12

FROM python:${PYTHON_VERSION}-slim

ARG ENTRYPOINT="fastapi run src/main.py"

WORKDIR /app

COPY pyproject.toml ./

RUN pip install --no-cache-dir .;

COPY . .

EXPOSE 8000

ENTRYPOINT ${ENTRYPOINT}

0 comments on commit d03ef63

Please sign in to comment.