songhieng commited on
Commit
d12d51e
·
verified ·
1 Parent(s): 45b22d9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -26
Dockerfile CHANGED
@@ -1,26 +1,28 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
-
4
- # Set the working directory in the container
5
- WORKDIR /app
6
-
7
- # Install system dependencies needed for building some Python packages
8
- RUN apt-get update && apt-get install -y \
9
- cmake \
10
- build-essential \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # Copy the requirements file into the container at /app
14
- COPY requirements.txt /app/requirements.txt
15
-
16
- # Install any needed packages specified in requirements.txt
17
- RUN pip install --no-cache-dir -r /app/requirements.txt
18
-
19
- # Copy the rest of the application code to /app
20
- COPY . /app
21
-
22
- # Expose port 8000 to the outside world
23
- EXPOSE 8000
24
-
25
- # Command to run the FastAPI application using Uvicorn
26
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies needed for OpenCV and building some Python packages
8
+ RUN apt-get update && apt-get install -y \
9
+ libgl1-mesa-glx \
10
+ libglib2.0-0 \
11
+ cmake \
12
+ build-essential \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Copy the requirements file into the container at /app
16
+ COPY requirements.txt /app/requirements.txt
17
+
18
+ # Install any needed packages specified in requirements.txt
19
+ RUN pip install --no-cache-dir -r /app/requirements.txt
20
+
21
+ # Copy the rest of the application code to /app
22
+ COPY . /app
23
+
24
+ # Expose port 8000 to the outside world
25
+ EXPOSE 8000
26
+
27
+ # Command to run the FastAPI application using Uvicorn
28
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]