Spaces:
Running
Running
Bahodir Nematjonov
commited on
Commit
·
e5cbb51
1
Parent(s):
7c59172
debuging docker
Browse files- Dockerfile +12 -9
- requirements.txt +1 -1
Dockerfile
CHANGED
@@ -1,19 +1,22 @@
|
|
1 |
-
# Use a lightweight
|
2 |
-
FROM
|
3 |
|
4 |
# Set working directory
|
5 |
WORKDIR /code
|
6 |
|
7 |
-
# Install dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
COPY requirements.txt .
|
9 |
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
-
#
|
12 |
-
ENV TRANSFORMERS_NO_ADVISORY_WARNINGS=1
|
13 |
-
ENV HF_HOME="/code/hf_cache"
|
14 |
-
|
15 |
-
# Expose API port
|
16 |
EXPOSE 7860
|
17 |
|
18 |
-
#
|
19 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use a lightweight Python image
|
2 |
+
FROM python:3.9
|
3 |
|
4 |
# Set working directory
|
5 |
WORKDIR /code
|
6 |
|
7 |
+
# Install system dependencies required for PostgreSQL and transformers
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
libpq-dev \
|
10 |
+
python3-dev \
|
11 |
+
gcc \
|
12 |
+
&& rm -rf /var/lib/apt/lists/*
|
13 |
+
|
14 |
+
# Copy requirements.txt and install dependencies
|
15 |
COPY requirements.txt .
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
+
# Expose FastAPI port
|
|
|
|
|
|
|
|
|
19 |
EXPOSE 7860
|
20 |
|
21 |
+
# Start FastAPI
|
22 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
CHANGED
@@ -30,7 +30,7 @@ sentence_transformers
|
|
30 |
pinecone-client
|
31 |
python-multipart
|
32 |
sqlalchemy
|
33 |
-
psycopg2
|
34 |
python-dotenv
|
35 |
torch
|
36 |
transformers
|
|
|
30 |
pinecone-client
|
31 |
python-multipart
|
32 |
sqlalchemy
|
33 |
+
psycopg2-binary
|
34 |
python-dotenv
|
35 |
torch
|
36 |
transformers
|