Update Dockerfile
Browse files- Dockerfile +11 -13
Dockerfile
CHANGED
|
@@ -1,20 +1,18 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy
|
| 8 |
-
COPY .
|
| 9 |
-
|
| 10 |
-
# Install any needed packages specified in requirements.txt
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
|
| 19 |
-
# Run
|
| 20 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use lightweight Python image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements and install
|
| 8 |
+
COPY requirements.txt .
|
|
|
|
|
|
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
+
# Copy app
|
| 12 |
+
COPY main.py .
|
| 13 |
|
| 14 |
+
# Expose FastAPI port
|
| 15 |
+
EXPOSE 8000
|
| 16 |
|
| 17 |
+
# Run the app
|
| 18 |
+
CMD ["uvicorn", "main.py:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|