Update Dockerfile
Browse files- Dockerfile +9 -6
Dockerfile
CHANGED
@@ -1,15 +1,18 @@
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
#
|
4 |
WORKDIR /app
|
5 |
-
COPY fruit-model /app/fruit-model
|
6 |
|
|
|
|
|
|
|
7 |
|
8 |
-
# Copy
|
9 |
COPY . .
|
10 |
|
11 |
-
#
|
12 |
-
|
13 |
|
14 |
-
#
|
15 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Use official Python image as base
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set working directory
|
5 |
WORKDIR /app
|
|
|
6 |
|
7 |
+
# Copy requirements and install
|
8 |
+
COPY requirements.txt .
|
9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
+
# Copy app files
|
12 |
COPY . .
|
13 |
|
14 |
+
# Expose port 7860 (default for HF Spaces)
|
15 |
+
EXPOSE 7860
|
16 |
|
17 |
+
# Command to run your FastAPI app with Uvicorn
|
18 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|