Update Dockerfile
Browse files- Dockerfile +21 -5
Dockerfile
CHANGED
|
@@ -1,11 +1,27 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
RUN
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
EXPOSE 3000
|
| 11 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
+
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
|
| 8 |
+
# Set the working directory in the container
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Install system dependencies (if any)
|
| 12 |
+
# RUN apt-get update && apt-get install -y <dependencies>
|
| 13 |
+
|
| 14 |
+
# Copy requirements.txt first to leverage Docker cache
|
| 15 |
+
COPY requirements.txt .
|
| 16 |
|
| 17 |
+
# Install Python dependencies
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
+
# Copy the application code
|
| 21 |
+
COPY app/ /app/
|
| 22 |
+
|
| 23 |
+
# Expose the port FastAPI is running on
|
| 24 |
EXPOSE 3000
|
| 25 |
+
|
| 26 |
+
# Command to run the application
|
| 27 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "3000"]
|