Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +12 -8
Dockerfile
CHANGED
@@ -1,14 +1,18 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
COPY ./requirements.txt /code/requirements.txt
|
6 |
-
|
7 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
|
|
9 |
COPY . .
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
#
|
14 |
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:7860"]
|
|
|
1 |
+
# Use a base image with Python
|
2 |
+
FROM python:3.10
|
3 |
|
4 |
+
# Set the working directory
|
5 |
+
WORKDIR /app
|
|
|
|
|
|
|
6 |
|
7 |
+
# Copy the app files
|
8 |
COPY . .
|
9 |
|
10 |
+
# Install dependencies
|
11 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
12 |
+
pip install -r requirements.txt
|
13 |
+
|
14 |
+
# Install Gunicorn (if not in requirements.txt)
|
15 |
+
RUN pip install gunicorn uvicorn
|
16 |
|
17 |
+
# Run the app with multiple workers
|
18 |
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "app:app", "--bind", "0.0.0.0:7860"]
|