-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 898 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (20 loc) · 898 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Use a lightweight Python image
FROM python:3.10-slim
# Set environment variables for non-interactive installs
ENV PYTHONUNBUFFERED=1
# Install necessary system dependencies (like ffmpeg for video processing)
# The need for ffmpeg is likely contributing to your memory issues.
RUN apt-get update && \
apt-get install -y ffmpeg libsm6 libxext6 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# Copy the requirements file and install Python dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code (e.g., the 'app' directory)
COPY . .
# Expose the application port
EXPOSE 8000
# Simple command to run the application (assuming app/main.py and an app object)
# If your ML service uses Gunicorn, change this back to the Gunicorn command.
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]