Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +7 -7
Dockerfile
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
-
# Use the official Python
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy the requirements file
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
-
# Install dependencies
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
# Copy the application
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
-
# Expose the port
|
| 17 |
EXPOSE 8000
|
| 18 |
|
| 19 |
-
# Start the
|
| 20 |
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000", "--log-level", "debug", "--access-logfile", "-"]
|
|
|
|
| 1 |
+
# Use the official Python 3.9 slim image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the requirements.txt file into the container
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
+
# Install the dependencies specified in requirements.txt
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy the entire application code into the container
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
+
# Expose the port that FastAPI will use
|
| 17 |
EXPOSE 8000
|
| 18 |
|
| 19 |
+
# Start the FastAPI app with Gunicorn for better performance
|
| 20 |
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000", "--log-level", "debug", "--access-logfile", "-"]
|