-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile.nvidia
More file actions
56 lines (43 loc) · 1.5 KB
/
Dockerfile.nvidia
File metadata and controls
56 lines (43 loc) · 1.5 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
48
49
50
51
52
53
54
55
56
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
# Install Python 3.10 and system dependencies
RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install -y --no-install-recommends \
python3.10 \
python3.10-dev \
python3-pip \
git \
wget \
curl \
build-essential \
ca-certificates \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3.10 as default
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
# Disable pip progress bar to avoid threading issues
ENV PIP_PROGRESS_BAR=off
ENV PIP_NO_INPUT=1
# Upgrade pip
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
# Copy requirements file
COPY requirements.txt .
# Install Python dependencies from requirements.txt (includes PyTorch)
RUN pip3 install --no-cache-dir -r requirements.txt
# Set working directory
WORKDIR /workspace/ai4c
# Copy project files (including .git directory to maintain git functionality)
COPY . .
# Reset any uncommitted changes to have a clean git state
RUN git reset --hard HEAD
# Set PYTHONPATH
ENV PYTHONPATH=/workspace/ai4c:$PYTHONPATH
# Set environment variables for AI4C (these should be overridden at runtime)
ENV AI4C_BASE_URL=""
ENV AI4C_API_KEY=""
ENV AI4C_API_MODEL_NAME=""
# Default command
CMD ["/bin/bash"]