tejash300 commited on
Commit
de6f70a
·
verified ·
1 Parent(s): 8ad1fcd

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.9-slim
3
+
4
+ # Disable Python buffering for easier container logging
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ # Set the working directory in the container
8
+ WORKDIR /app
9
+
10
+ # Install system dependencies (ffmpeg is needed for video processing, libsm6 and libxext6 support image/video)
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ ffmpeg \
13
+ libsm6 \
14
+ libxext6 \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Copy the requirements file into the container
18
+ COPY requirements.txt /app/requirements.txt
19
+
20
+ # Upgrade pip and install Python dependencies
21
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Download spaCy's small English model
24
+ RUN python -m spacy download en_core_web_sm
25
+
26
+ # Copy the rest of your application code into the container
27
+ COPY . /app
28
+
29
+ # Expose the port your app runs on
30
+ EXPOSE 8500
31
+
32
+ # Run the FastAPI application using uvicorn
33
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8500"]