Update Dockerfile
Browse files- Dockerfile +8 -9
Dockerfile
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
-
#
|
2 |
-
|
3 |
-
# Use official Python image as base
|
4 |
FROM python:3.11-slim
|
5 |
|
6 |
# Set environment variables
|
@@ -11,20 +9,21 @@ ENV PYTHONUNBUFFERED=1
|
|
11 |
WORKDIR /app
|
12 |
|
13 |
# Install system dependencies
|
14 |
-
RUN apt-get update && apt-get install -y
|
15 |
build-essential \
|
|
|
16 |
&& rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
# Install dependencies
|
19 |
COPY requirements.txt .
|
20 |
RUN pip install --upgrade pip
|
21 |
-
RUN pip install -r requirements.txt
|
22 |
|
23 |
-
# Copy
|
24 |
-
COPY
|
25 |
|
26 |
-
# Expose port
|
27 |
EXPOSE 8000
|
28 |
|
29 |
-
#
|
30 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
1 |
+
# Use the official Python image from the Docker Hub
|
|
|
|
|
2 |
FROM python:3.11-slim
|
3 |
|
4 |
# Set environment variables
|
|
|
9 |
WORKDIR /app
|
10 |
|
11 |
# Install system dependencies
|
12 |
+
RUN apt-get update && apt-get install -y \
|
13 |
build-essential \
|
14 |
+
libglib2.0-0 \
|
15 |
&& rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
# Install dependencies
|
18 |
COPY requirements.txt .
|
19 |
RUN pip install --upgrade pip
|
20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
21 |
|
22 |
+
# Copy the application code
|
23 |
+
COPY . .
|
24 |
|
25 |
+
# Expose the port FastAPI is running on
|
26 |
EXPOSE 8000
|
27 |
|
28 |
+
# Define the default command to run the application
|
29 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|