Spaces:
Runtime error
Runtime error
Kartikeyssj2
commited on
Update Dockerfile
Browse files- Dockerfile +10 -7
Dockerfile
CHANGED
@@ -1,21 +1,24 @@
|
|
|
|
1 |
FROM python:3.12.3-slim
|
2 |
|
|
|
3 |
WORKDIR /app
|
4 |
|
|
|
5 |
COPY requirements.txt .
|
6 |
|
7 |
-
# INSTALL
|
8 |
RUN apt-get update \
|
9 |
-
&& apt-get install -y git \
|
10 |
&& pip install --upgrade pip \
|
11 |
&& pip install -r requirements.txt \
|
12 |
&& apt-get clean
|
13 |
|
14 |
-
|
15 |
-
&& pip install -r requirements.txt
|
16 |
-
|
17 |
COPY . .
|
18 |
|
|
|
|
|
19 |
|
20 |
-
#
|
21 |
-
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "fast_api:app"]
|
|
|
1 |
+
# BASE IMAGE
|
2 |
FROM python:3.12.3-slim
|
3 |
|
4 |
+
# SET WORKING DIRECTORY
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# COPY REQUIREMENTS FILE
|
8 |
COPY requirements.txt .
|
9 |
|
10 |
+
# INSTALL SYSTEM DEPENDENCIES AND UPGRADE PIP
|
11 |
RUN apt-get update \
|
12 |
+
&& apt-get install -y git build-essential libffi-dev libssl-dev python3-dev \
|
13 |
&& pip install --upgrade pip \
|
14 |
&& pip install -r requirements.txt \
|
15 |
&& apt-get clean
|
16 |
|
17 |
+
# COPY ALL CONTENTS OF THE CURRENT DIRECTORY
|
|
|
|
|
18 |
COPY . .
|
19 |
|
20 |
+
# RUN THE PYTHON SCRIPT TO DOWNLOAD NECESSARY MODELS AND FILES
|
21 |
+
RUN python download_models.py
|
22 |
|
23 |
+
# USE 4 WORKER PROCESSES AND ENABLE LOGGING TO STDOUT
|
24 |
+
CMD ["gunicorn", "-w", "4", "-k", "uvicorn.workers.UvicornWorker", "fast_api:app", "--log-level", "info", "--access-logfile", "-", "--error-logfile", "-"]
|