Spaces:
Runtime error
Runtime error
srivatsavdamaraju
commited on
Commit
•
f12cf77
1
Parent(s):
8161e41
Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
@@ -5,7 +5,10 @@ FROM python:3.9-slim
|
|
5 |
ENV PYTHONDONTWRITEBYTECODE 1
|
6 |
ENV PYTHONUNBUFFERED 1
|
7 |
|
8 |
-
# Step 3:
|
|
|
|
|
|
|
9 |
RUN apt-get update && apt-get install -y \
|
10 |
gcc \
|
11 |
g++ \
|
@@ -14,20 +17,20 @@ RUN apt-get update && apt-get install -y \
|
|
14 |
libglib2.0-0 \
|
15 |
&& rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
-
# Step
|
18 |
WORKDIR /app
|
19 |
|
20 |
-
# Step
|
21 |
COPY requirements.txt /app/
|
22 |
|
23 |
-
# Step
|
24 |
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
|
26 |
-
# Step
|
27 |
COPY . /app/
|
28 |
|
29 |
-
# Step
|
30 |
EXPOSE 5000
|
31 |
|
32 |
-
# Step
|
33 |
CMD ["python", "app.py"]
|
|
|
5 |
ENV PYTHONDONTWRITEBYTECODE 1
|
6 |
ENV PYTHONUNBUFFERED 1
|
7 |
|
8 |
+
# Step 3: Set the environment variable for PyTorch cache
|
9 |
+
ENV TORCH_HOME=/app/.cache
|
10 |
+
|
11 |
+
# Step 4: Install system dependencies
|
12 |
RUN apt-get update && apt-get install -y \
|
13 |
gcc \
|
14 |
g++ \
|
|
|
17 |
libglib2.0-0 \
|
18 |
&& rm -rf /var/lib/apt/lists/*
|
19 |
|
20 |
+
# Step 5: Set the working directory inside the container
|
21 |
WORKDIR /app
|
22 |
|
23 |
+
# Step 6: Copy the requirements file into the container
|
24 |
COPY requirements.txt /app/
|
25 |
|
26 |
+
# Step 7: Install the Python dependencies
|
27 |
RUN pip install --no-cache-dir -r requirements.txt
|
28 |
|
29 |
+
# Step 8: Copy the rest of the application files into the container
|
30 |
COPY . /app/
|
31 |
|
32 |
+
# Step 9: Expose the port that the Flask app will run on
|
33 |
EXPOSE 5000
|
34 |
|
35 |
+
# Step 10: Set the entry point to start the Flask application
|
36 |
CMD ["python", "app.py"]
|