File tree Expand file tree Collapse file tree 5 files changed +17
-28
lines changed Expand file tree Collapse file tree 5 files changed +17
-28
lines changed Original file line number Diff line number Diff line change 1
1
FROM mcr.microsoft.com/devcontainers/python:3.11-bookworm
2
2
3
- COPY ./app/requirements.txt /app/requirements.txt
4
- RUN pip install --no-cache-dir -r app/requirements.txt
3
+ RUN pip install --no-cache-dir poetry
4
+ COPY ./app/pyproject.toml /app/pyproject.toml
5
+ RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
5
6
6
7
COPY ./app /app
8
+
Original file line number Diff line number Diff line change 18
18
uses : actions/setup-python@v5
19
19
with :
20
20
python-version : ' 3.11'
21
+
22
+ - name : Install poetry
23
+ run : pipx install poetry
24
+
21
25
- name : Checkout Repo
22
26
uses : actions/checkout@v4
23
27
@@ -35,15 +39,15 @@ jobs:
35
39
role-duration-seconds : 1200
36
40
role-to-assume : arn:aws:iam::407839483216:role/admin
37
41
38
- - name : Set up cache for pip dependencies
42
+ - name : Set up cache for Poetry dependencies
39
43
uses : actions/cache@v4
40
44
with :
41
- path : ~/.cache/pip
42
- key : ${{ runner.os }}-pip- ${{ hashFiles('app/requirements.txt ') }}
45
+ path : ~/.cache/pypoetry
46
+ key : poetry- ${{ hashFiles('app/poetry.lock ') }}
43
47
44
- - name : Install Python dependencies
48
+ - name : Install Python dependencies with Poetry
45
49
working-directory : ./app
46
- run : pip install -r requirements.txt
50
+ run : poetry install --no-interaction --no-root
47
51
48
52
- name : Update knowledge_base.json
49
53
working-directory : ./app
Original file line number Diff line number Diff line change @@ -25,13 +25,11 @@ RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
25
25
apt-get install -y nodejs
26
26
27
27
# Install uWSGI and GitPython
28
- RUN pip install uwsgi gitpython
28
+ RUN pip install --no-cache-dir poetry uwsgi gitpython
29
29
30
- # Copy the requirements file first to leverage Docker's cache
31
- COPY requirements.txt /app/
32
-
33
- # Install Python dependencies
34
- RUN pip install --no-cache-dir -r requirements.txt
30
+ # Copy poetry files
31
+ COPY pyproject.toml poetry.lock* ./
32
+ RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root
35
33
36
34
# Copy the application source code into the container
37
35
COPY . /app
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ description = ""
5
5
authors = [
6
6
{
name =
" Defang Devs" ,
email =
" [email protected] " }
7
7
]
8
- readme = " README.md"
9
8
requires-python = " >=3.11,<4.0"
10
9
dependencies = [
11
10
" flask (==2.0.1)" ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments