Spaces:
Runtime error
Runtime error
PMS61
commited on
Commit
·
fbd0a6b
1
Parent(s):
eed52dc
fixes
Browse files- Dockerfile +7 -9
Dockerfile
CHANGED
@@ -4,10 +4,11 @@ FROM python:3.10-slim
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /code
|
6 |
|
7 |
-
# Set
|
8 |
ENV PYTHONPATH="/code"
|
|
|
9 |
|
10 |
-
# Install system dependencies
|
11 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
12 |
build-essential \
|
13 |
ffmpeg \
|
@@ -15,19 +16,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
15 |
libxext6 \
|
16 |
&& rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
-
# Copy
|
19 |
COPY ./requirements.txt /code/requirements.txt
|
20 |
-
|
21 |
-
# Install any needed packages specified in requirements.txt
|
22 |
-
# We add gunicorn here for a production-ready web server
|
23 |
RUN pip install --no-cache-dir --upgrade pip
|
24 |
RUN pip install --no-cache-dir -r requirements.txt gunicorn gevent
|
25 |
|
26 |
-
# Copy the
|
27 |
COPY . /code/
|
28 |
|
29 |
-
# Expose the port
|
30 |
EXPOSE 7860
|
31 |
|
32 |
-
#
|
33 |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "4", "--worker-class", "gevent", "--timeout", "600", "app:app"]
|
|
|
4 |
# Set the working directory in the container
|
5 |
WORKDIR /code
|
6 |
|
7 |
+
# Set environment variables for caching
|
8 |
ENV PYTHONPATH="/code"
|
9 |
+
ENV HF_HOME="/code/.cache"
|
10 |
|
11 |
+
# Install system dependencies
|
12 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
13 |
build-essential \
|
14 |
ffmpeg \
|
|
|
16 |
libxext6 \
|
17 |
&& rm -rf /var/lib/apt/lists/*
|
18 |
|
19 |
+
# Copy and install Python dependencies
|
20 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
|
|
|
21 |
RUN pip install --no-cache-dir --upgrade pip
|
22 |
RUN pip install --no-cache-dir -r requirements.txt gunicorn gevent
|
23 |
|
24 |
+
# Copy the application code
|
25 |
COPY . /code/
|
26 |
|
27 |
+
# Expose the port
|
28 |
EXPOSE 7860
|
29 |
|
30 |
+
# Run the application
|
31 |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "4", "--worker-class", "gevent", "--timeout", "600", "app:app"]
|