Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -17
Dockerfile
CHANGED
@@ -1,29 +1,18 @@
|
|
1 |
-
# Use
|
2 |
-
FROM python:3.9
|
3 |
|
4 |
-
# Set
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copy requirements file and install dependencies
|
8 |
COPY requirements.txt .
|
9 |
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
-
#
|
12 |
-
RUN apt-get update && apt-get install -y \
|
13 |
-
libgl1-mesa-glx \
|
14 |
-
libglib2.0-0 \
|
15 |
-
&& rm -rf /var/lib/apt/lists/*
|
16 |
-
|
17 |
-
# Copy application files
|
18 |
COPY . .
|
19 |
|
20 |
-
# Expose the port
|
21 |
EXPOSE 7860
|
22 |
|
23 |
-
#
|
24 |
-
ENV TOKENIZERS_PARALLELISM=false \
|
25 |
-
TRANSFORMERS_OFFLINE=1 \
|
26 |
-
HF_DATASETS_OFFLINE=1
|
27 |
-
|
28 |
-
# Run the application using Gunicorn with multiple workers
|
29 |
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]
|
|
|
1 |
+
# Use official Python image
|
2 |
+
FROM python:3.9
|
3 |
|
4 |
+
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Copy requirements file and install dependencies
|
8 |
COPY requirements.txt .
|
9 |
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
|
11 |
+
# Copy the entire application
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
COPY . .
|
13 |
|
14 |
+
# Expose the application port
|
15 |
EXPOSE 7860
|
16 |
|
17 |
+
# Command to run the application
|
|
|
|
|
|
|
|
|
|
|
18 |
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]
|