Spaces:
Sleeping
Sleeping
Praneeth Yerrapragada
commited on
Commit
•
f48a9aa
1
Parent(s):
12a9bf1
build: fix dockerfile and test to make it work
Browse files- .dockerignore +3 -0
- Dockerfile +16 -13
- poetry.lock +0 -0
- pyproject.toml +31 -0
.dockerignore
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
__pycache__
|
2 |
+
storage
|
3 |
+
data/*
|
Dockerfile
CHANGED
@@ -1,24 +1,27 @@
|
|
1 |
-
|
2 |
-
FROM python:3.11
|
3 |
|
4 |
# Set the working directory to /app
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
|
8 |
-
ADD . /app
|
9 |
|
10 |
# Install any needed packages specified in requirements.txt
|
11 |
-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install
|
12 |
-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install pipenv && pipenv install
|
13 |
-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install -r requirements.txt
|
14 |
|
15 |
-
|
16 |
-
|
|
|
17 |
|
18 |
# Download the 'stopwords' resource before running the app
|
19 |
-
RUN python -c "import nltk; nltk.download('stopwords')"
|
|
|
|
|
|
|
|
|
20 |
|
21 |
-
|
|
|
|
|
|
|
22 |
|
23 |
-
|
24 |
-
CMD ["python", "main.py"]
|
|
|
1 |
+
FROM python:3.11 as build
|
|
|
2 |
|
3 |
# Set the working directory to /app
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
ENV PYTHONPATH=/app
|
|
|
7 |
|
8 |
# Install any needed packages specified in requirements.txt
|
9 |
+
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install poetry
|
|
|
|
|
10 |
|
11 |
+
COPY ./pyproject.toml ./poetry.lock* /app/
|
12 |
+
RUN poetry install
|
13 |
+
# --no-root --no-cache --only main
|
14 |
|
15 |
# Download the 'stopwords' resource before running the app
|
16 |
+
# RUN python -c "import nltk; nltk.download('stopwords')"
|
17 |
+
# RUN chmod -R 775 /usr/local/lib/python3.11/site-packages/llama_index
|
18 |
+
|
19 |
+
# ====================================
|
20 |
+
FROM build as release
|
21 |
|
22 |
+
COPY . .
|
23 |
+
|
24 |
+
# Make port 8000 available to the world outside this container
|
25 |
+
EXPOSE 8000
|
26 |
|
27 |
+
CMD ["poetry", "run", "python", "main.py"]
|
|
poetry.lock
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pyproject.toml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[tool]
|
2 |
+
[tool.poetry]
|
3 |
+
name = "app"
|
4 |
+
version = "0.1.0"
|
5 |
+
description = ""
|
6 |
+
authors = [ "Marcus Schiesser <mail@marcusschiesser.de>" ]
|
7 |
+
readme = "README.md"
|
8 |
+
|
9 |
+
[tool.poetry.scripts]
|
10 |
+
generate = "app.engine.generate:generate_datasource"
|
11 |
+
|
12 |
+
[tool.poetry.dependencies]
|
13 |
+
python = "^3.11,<3.12"
|
14 |
+
fastapi = "^0.109.1"
|
15 |
+
python-dotenv = "^1.0.0"
|
16 |
+
aiostream = "^0.5.2"
|
17 |
+
llama-index = "0.10.28"
|
18 |
+
llama-index-core = "0.10.28"
|
19 |
+
llama-index-vector-stores-pinecone = "^0.1.7"
|
20 |
+
traceloop-sdk = "^0.19.0"
|
21 |
+
|
22 |
+
[tool.poetry.dependencies.uvicorn]
|
23 |
+
extras = [ "standard" ]
|
24 |
+
version = "^0.23.2"
|
25 |
+
|
26 |
+
[tool.poetry.dependencies.llama-index-agent-openai]
|
27 |
+
version = "0.2.2"
|
28 |
+
|
29 |
+
[build-system]
|
30 |
+
requires = [ "poetry-core" ]
|
31 |
+
build-backend = "poetry.core.masonry.api"
|