Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -15
Dockerfile
CHANGED
@@ -16,28 +16,23 @@
|
|
16 |
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
17 |
|
18 |
# Use a base image with Python and necessary dependencies
|
19 |
-
|
20 |
-
|
21 |
-
# Set environment variables
|
22 |
-
ENV PYTHONDONTWRITEBYTECODE=1
|
23 |
-
ENV PYTHONUNBUFFERED=1
|
24 |
|
25 |
# Set the working directory
|
26 |
WORKDIR /app
|
27 |
|
28 |
-
#
|
29 |
-
COPY requirements.txt .
|
30 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
31 |
-
|
32 |
-
# Copy the application code and model download script
|
33 |
COPY . .
|
34 |
|
35 |
-
#
|
36 |
-
RUN
|
|
|
37 |
|
38 |
-
#
|
39 |
-
|
40 |
|
41 |
# Command to run the FastAPI app
|
42 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
43 |
|
|
|
16 |
# CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
17 |
|
18 |
# Use a base image with Python and necessary dependencies
|
19 |
+
# Use an appropriate base image
|
20 |
+
FROM python:3.9
|
|
|
|
|
|
|
21 |
|
22 |
# Set the working directory
|
23 |
WORKDIR /app
|
24 |
|
25 |
+
# Copy the necessary files
|
|
|
|
|
|
|
|
|
26 |
COPY . .
|
27 |
|
28 |
+
# Install dependencies
|
29 |
+
RUN pip install --upgrade pip
|
30 |
+
RUN pip install -r requirements.txt
|
31 |
|
32 |
+
# Run the script to download the model
|
33 |
+
RUN python download_model.py
|
34 |
|
35 |
# Command to run the FastAPI app
|
36 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
37 |
+
|
38 |
|