Spaces:
Runtime error
Runtime error
srivatsavdamaraju
commited on
Commit
•
fcd6a9a
1
Parent(s):
3f83a7b
Update Dockerfile
Browse files- Dockerfile +11 -8
Dockerfile
CHANGED
@@ -5,8 +5,8 @@ FROM python:3.9-slim
|
|
5 |
ENV PYTHONDONTWRITEBYTECODE 1
|
6 |
ENV PYTHONUNBUFFERED 1
|
7 |
|
8 |
-
# Step 3:
|
9 |
-
ENV TORCH_HOME
|
10 |
ENV TORCH_HUB_NO_CACHE=1
|
11 |
|
12 |
# Step 4: Install system dependencies
|
@@ -21,17 +21,20 @@ RUN apt-get update && apt-get install -y \
|
|
21 |
# Step 5: Set the working directory inside the container
|
22 |
WORKDIR /app
|
23 |
|
24 |
-
# Step 6:
|
|
|
|
|
|
|
25 |
COPY requirements.txt /app/
|
26 |
|
27 |
-
# Step
|
28 |
RUN pip install --no-cache-dir -r requirements.txt
|
29 |
|
30 |
-
# Step
|
31 |
-
COPY . /
|
32 |
|
33 |
-
# Step
|
34 |
EXPOSE 5000
|
35 |
|
36 |
-
# Step
|
37 |
CMD ["python", "app.py"]
|
|
|
5 |
ENV PYTHONDONTWRITEBYTECODE 1
|
6 |
ENV PYTHONUNBUFFERED 1
|
7 |
|
8 |
+
# Step 3: Set environment variables for torch cache directory and disable caching
|
9 |
+
ENV TORCH_HOME=/app/.cache
|
10 |
ENV TORCH_HUB_NO_CACHE=1
|
11 |
|
12 |
# Step 4: Install system dependencies
|
|
|
21 |
# Step 5: Set the working directory inside the container
|
22 |
WORKDIR /app
|
23 |
|
24 |
+
# Step 6: Create the cache directory and ensure it's writable
|
25 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
26 |
+
|
27 |
+
# Step 7: Copy the requirements file into the container
|
28 |
COPY requirements.txt /app/
|
29 |
|
30 |
+
# Step 8: Install the Python dependencies
|
31 |
RUN pip install --no-cache-dir -r requirements.txt
|
32 |
|
33 |
+
# Step 9: Copy the rest of the application files into the container
|
34 |
+
COPY . /app/
|
35 |
|
36 |
+
# Step 10: Expose the port that the Flask app will run on
|
37 |
EXPOSE 5000
|
38 |
|
39 |
+
# Step 11: Set the entry point to start the Flask application
|
40 |
CMD ["python", "app.py"]
|