Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +10 -13
Dockerfile
CHANGED
|
@@ -1,21 +1,18 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
# Set working directory
|
| 4 |
WORKDIR /code
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
RUN apk add --no-cache --virtual .build-deps \
|
| 8 |
-
gcc musl-dev libffi-dev make
|
| 9 |
-
|
| 10 |
-
# Install Python dependencies
|
| 11 |
COPY ./requirements.txt /code/requirements.txt
|
| 12 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
|
| 20 |
-
#
|
| 21 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use a Python 3.10 Slim image as the base
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
# Copy the requirements file to the container
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
| 9 |
|
| 10 |
+
# Upgrade pip to the latest version and install the dependencies
|
| 11 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 12 |
+
pip install --no-cache-dir -r /code/requirements.txt
|
| 13 |
|
| 14 |
+
# Copy the rest of the project files into the container
|
| 15 |
+
COPY . .
|
| 16 |
|
| 17 |
+
# Set the default command to run your application
|
| 18 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|