Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -7
Dockerfile
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
# 1.
|
| 2 |
FROM python:3.10
|
| 3 |
|
| 4 |
-
# 2. Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# 3. Install system
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
libgl1-mesa-glx \
|
|
@@ -12,15 +12,17 @@ RUN apt-get update && apt-get install -y \
|
|
| 12 |
curl \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# 4. Copy and install
|
|
|
|
| 16 |
COPY requirements.txt .
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# 5. Copy the rest of your
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
# 6. Hugging Face Spaces
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
-
# 7. Start the
|
|
|
|
| 26 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
# 1. FORCE Python 3.10 - This is the most important line
|
| 2 |
FROM python:3.10
|
| 3 |
|
| 4 |
+
# 2. Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# 3. Install Linux system libraries (needed for OpenCV and image processing)
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
libgl1-mesa-glx \
|
|
|
|
| 12 |
curl \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
+
# 4. Copy requirements and install them
|
| 16 |
+
# We do this before copying the code to make builds faster
|
| 17 |
COPY requirements.txt .
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
+
# 5. Copy the rest of your application
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
+
# 6. Hugging Face Spaces REQUIRES port 7860
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# 7. Start the application
|
| 27 |
+
# Make sure your main file is named 'app.py'. If not, change 'app.py' below.
|
| 28 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|