-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.31 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (36 loc) · 1.31 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM nvidia/cuda:12.4.1-devel-ubuntu22.04
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
git \
ninja-build \
cmake \
libcudnn9-cuda-12 \
libcudnn9-dev-cuda-12 \
ffmpeg \
imagemagick \
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip
RUN pip3 install --no-cache-dir --upgrade pip
# Install moviepy first
RUN pip3 install --no-cache-dir moviepy==1.0.3
# Copy requirements file
COPY requirements.txt /tmp/requirements.txt
# Install Python dependencies
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
# Verify pydantic installation
RUN python3 -c "import pydantic; print(f'Pydantic version: {pydantic.__version__}')" && \
python3 -c "import pydantic_core; print(f'Pydantic-core version: {pydantic_core.__version__}')"
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONPATH=/app/src:/usr/local/lib/python3.10/site-packages:/usr/local/lib/python3/dist-packages:/usr/local/lib/python3.10/site-packages
ENV CUDA_VISIBLE_DEVICES=0
ENV TORCH_CUDA_ARCH_LIST="8.0;8.6;8.9;9.0"
# Create necessary directories
RUN mkdir -p /app/src /app/models /app/storage
# Expose the port
EXPOSE 8000
# Run the application with uvicorn
CMD ["python3", "-m", "uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]