Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +28 -28
Dockerfile
CHANGED
|
@@ -1,28 +1,28 @@
|
|
| 1 |
-
FROM python:3.9-slim
|
| 2 |
-
|
| 3 |
-
# Install system dependencies required for OpenCV
|
| 4 |
-
RUN apt-get update && apt-get install -y \
|
| 5 |
-
libgl1
|
| 6 |
-
libglib2.0-0 \
|
| 7 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
-
|
| 9 |
-
# Set up a new user named "user" with user ID 1000
|
| 10 |
-
RUN useradd -m -u 1000 user
|
| 11 |
-
USER user
|
| 12 |
-
ENV HOME=/home/user \
|
| 13 |
-
PATH=/home/user/.local/bin:$PATH
|
| 14 |
-
|
| 15 |
-
WORKDIR $HOME/app
|
| 16 |
-
|
| 17 |
-
# Copy the requirements file and install dependencies
|
| 18 |
-
COPY --chown=user requirements_web.txt .
|
| 19 |
-
RUN pip install --no-cache-dir -r requirements_web.txt gunicorn
|
| 20 |
-
|
| 21 |
-
# Copy the rest of the application
|
| 22 |
-
COPY --chown=user . .
|
| 23 |
-
|
| 24 |
-
# Expose port 7860 (Hugging Face Spaces default port)
|
| 25 |
-
EXPOSE 7860
|
| 26 |
-
|
| 27 |
-
# Command to run the Flask application using Gunicorn
|
| 28 |
-
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "--workers", "1", "--threads", "2", "app:app"]
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
# Install system dependencies required for OpenCV
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
libgl1 \
|
| 6 |
+
libglib2.0-0 \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
# Set up a new user named "user" with user ID 1000
|
| 10 |
+
RUN useradd -m -u 1000 user
|
| 11 |
+
USER user
|
| 12 |
+
ENV HOME=/home/user \
|
| 13 |
+
PATH=/home/user/.local/bin:$PATH
|
| 14 |
+
|
| 15 |
+
WORKDIR $HOME/app
|
| 16 |
+
|
| 17 |
+
# Copy the requirements file and install dependencies
|
| 18 |
+
COPY --chown=user requirements_web.txt .
|
| 19 |
+
RUN pip install --no-cache-dir -r requirements_web.txt gunicorn
|
| 20 |
+
|
| 21 |
+
# Copy the rest of the application
|
| 22 |
+
COPY --chown=user . .
|
| 23 |
+
|
| 24 |
+
# Expose port 7860 (Hugging Face Spaces default port)
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Command to run the Flask application using Gunicorn
|
| 28 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "--workers", "1", "--threads", "2", "app:app"]
|