Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +5 -16
Dockerfile
CHANGED
@@ -2,30 +2,19 @@
|
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
-
WORKDIR /
|
6 |
-
|
7 |
# Copy the requirements file into the container at /app
|
8 |
COPY requirements.txt ./requirements.txt
|
9 |
|
10 |
-
# Install system dependencies
|
11 |
-
RUN apt-get update \
|
12 |
-
&& apt-get -y install libpq-dev gcc \
|
13 |
-
&& rm -rf /var/lib/apt/lists/*
|
14 |
|
15 |
-
|
16 |
-
RUN pip install psycopg2
|
17 |
|
18 |
# Install uvicorn
|
19 |
RUN pip install uvicorn
|
20 |
|
21 |
# Install Python dependencies
|
22 |
-
RUN pip install -r requirements.txt
|
23 |
|
24 |
# Copy the current directory contents into the container at /app
|
25 |
-
COPY .
|
26 |
-
|
27 |
-
# Set the entry point for running the application with Uvicorn
|
28 |
-
ENTRYPOINT ["uvicorn", "main:app"]
|
29 |
-
|
30 |
-
# Specify default command arguments for Uvicorn
|
31 |
-
CMD ["--host", "0.0.0.0", "--port", "7860"]
|
|
|
2 |
FROM python:3.9-slim
|
3 |
|
4 |
# Set the working directory in the container
|
5 |
+
WORKDIR /code
|
|
|
6 |
# Copy the requirements file into the container at /app
|
7 |
COPY requirements.txt ./requirements.txt
|
8 |
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
|
|
|
11 |
|
12 |
# Install uvicorn
|
13 |
RUN pip install uvicorn
|
14 |
|
15 |
# Install Python dependencies
|
16 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
17 |
|
18 |
# Copy the current directory contents into the container at /app
|
19 |
+
COPY . .
|
20 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "main:app"]
|
|
|
|
|
|
|
|
|
|