Update Dockerfile
Browse files- Dockerfile +9 -13
Dockerfile
CHANGED
@@ -1,21 +1,17 @@
|
|
1 |
-
# Use
|
2 |
-
FROM
|
3 |
|
4 |
-
# Set
|
5 |
WORKDIR /app
|
6 |
|
7 |
-
# Copy
|
8 |
-
COPY requirements.txt .
|
9 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
-
|
11 |
-
# Copy the application code
|
12 |
COPY . .
|
13 |
|
14 |
-
#
|
15 |
-
|
16 |
|
17 |
-
# Expose the port
|
18 |
EXPOSE 8001
|
19 |
|
20 |
-
#
|
21 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
|
|
|
1 |
+
# Use official Python image
|
2 |
+
FROM python:3.10-slim
|
3 |
|
4 |
+
# Set working directory
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Copy all project files
|
|
|
|
|
|
|
|
|
8 |
COPY . .
|
9 |
|
10 |
+
# Install dependencies
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
|
13 |
+
# Expose the port for FastAPI
|
14 |
EXPOSE 8001
|
15 |
|
16 |
+
# Command to run the FastAPI app with uvicorn
|
17 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"]
|