forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (29 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (29 loc) · 1.54 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
FROM gcr.io/based-hardware-dev/python:3.11-slim-forky AS builder
ENV PATH="/opt/venv/bin:$PATH"
RUN python -m venv /opt/venv
RUN apt-get update && apt-get install -y \
git \
gcc \
&& rm -rf /var/lib/apt/lists/*
COPY backend/requirements.txt /tmp/reqs/requirements.txt
COPY backend/modal/requirements.txt /tmp/reqs/modal/requirements.txt
RUN pip install --no-cache-dir -r /tmp/reqs/modal/requirements.txt
FROM gcr.io/based-hardware-dev/python:3.11-slim-forky
# Python 3.11 on Debian 14 (Forky)
WORKDIR /app
ENV PATH="/usr/local/nvidia/bin:/usr/local/cuda/bin:/opt/venv/bin:$PATH"
ENV LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64"
# Install CUDA Runtime 13.2 Update 1 only; the pod runs inference and does not need build tools like nvcc.
# Patch OS packages before installing runtime deps (#7136).
RUN apt-get update && apt-get -y dist-upgrade && \
apt-get -y install --no-install-recommends build-essential ffmpeg curl unzip wget && \
wget https://developer.download.nvidia.com/compute/cuda/13.2.1/local_installers/cuda-repo-debian13-13-2-local_13.2.1-595.58.03-1_amd64.deb && \
dpkg -i cuda-repo-debian13-13-2-local_13.2.1-595.58.03-1_amd64.deb && \
cp /var/cuda-repo-debian13-13-2-local/cuda-*-keyring.gpg /usr/share/keyrings/ && \
apt-get update && \
apt-get -y install cuda-runtime-13-2 && \
rm -rf /var/lib/apt/lists/* cuda-repo-debian13-13-2-local_13.2.1-595.58.03-1_amd64.deb
COPY --from=builder /opt/venv /opt/venv
COPY backend/modal/ .
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080", "--loop", "uvloop"]