Spaces:
Sleeping
Sleeping
Commit
·
69b771f
1
Parent(s):
8a40af2
FIX: Dockerfile syntax error - removed invalid comments
Browse files- Dockerfile +27 -22
- requirements.txt +3 -7
Dockerfile
CHANGED
|
@@ -2,30 +2,35 @@
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
Install system dependencies
|
| 6 |
-
RUN apt-get update && apt-get install -y
|
| 7 |
-
gcc
|
| 8 |
-
g++
|
| 9 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
-
|
| 11 |
-
Copy requirements
|
| 12 |
-
COPY
|
| 13 |
-
|
| 14 |
-
Install Python dependencies
|
| 15 |
-
RUN pip install --no-cache-dir -r
|
| 16 |
-
|
| 17 |
-
Copy application
|
| 18 |
-
COPY
|
| 19 |
-
COPY
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
RUN mkdir -p data
|
| 23 |
|
| 24 |
-
Expose port
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
-
Health check
|
| 28 |
-
HEALTHCHECK
|
|
|
|
| 29 |
|
| 30 |
-
Run the application
|
| 31 |
-
CMD ["python", "
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
gcc \
|
| 8 |
+
g++ \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Copy requirements
|
| 12 |
+
COPY requirements.txt .
|
| 13 |
+
|
| 14 |
+
# Install Python dependencies
|
| 15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
+
|
| 17 |
+
# Copy application
|
| 18 |
+
COPY app.py .
|
| 19 |
+
COPY README.md .
|
| 20 |
+
COPY test_api.py .
|
| 21 |
+
COPY app/ ./app/
|
| 22 |
+
COPY scripts/ ./scripts/
|
| 23 |
+
COPY config.py .
|
| 24 |
+
|
| 25 |
+
# Create data directory
|
| 26 |
RUN mkdir -p data
|
| 27 |
|
| 28 |
+
# Expose port
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
+
# Health check
|
| 32 |
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
| 33 |
+
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')"
|
| 34 |
|
| 35 |
+
# Run the application
|
| 36 |
+
CMD ["python", "app.py"]
|
requirements.txt
CHANGED
|
@@ -1,10 +1,6 @@
|
|
| 1 |
fastapi==0.104.1
|
| 2 |
uvicorn[standard]==0.24.0
|
| 3 |
-
sentence-transformers==2.2.2
|
| 4 |
-
faiss-cpu==1.7.4
|
| 5 |
-
numpy==1.24.3
|
| 6 |
-
pandas==2.1.3
|
| 7 |
-
psutil==5.9.6
|
| 8 |
-
python-multipart==0.0.6
|
| 9 |
-
pydantic==2.5.0
|
| 10 |
aiofiles==23.2.1
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
fastapi==0.104.1
|
| 2 |
uvicorn[standard]==0.24.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
aiofiles==23.2.1
|
| 4 |
+
pydantic==2.5.0
|
| 5 |
+
python-multipart==0.0.6
|
| 6 |
+
requests==2.31.0
|