Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- 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 by moviepy, and others support image/video processing)
|
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.txt file into the container at /app
|
18 |
+
COPY requirements.txt /app/requirements.txt
|
19 |
+
|
20 |
+
# Upgrade pip and install the Python dependencies
|
21 |
+
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
22 |
+
|
23 |
+
# Download spaCy's small English model (used by your app)
|
24 |
+
RUN python -m spacy download en_core_web_sm
|
25 |
+
|
26 |
+
# Copy the rest of your application code into the container at /app
|
27 |
+
COPY . /app
|
28 |
+
|
29 |
+
# Expose the port that your app runs on
|
30 |
+
EXPOSE 8500
|
31 |
+
|
32 |
+
# Run the application with Uvicorn
|
33 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8500"]
|