-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
33 lines (22 loc) · 927 Bytes
/
Dockerfile
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
# Build Stage
FROM debian:bookworm-slim AS builder
RUN apt-get update && \
apt-get install -y curl git python3 python3-pip python3-venv && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
mkdir -p /sam2-playground
WORKDIR /sam2-playground
COPY requirements.txt .
RUN python3 -m venv venv && \
. venv/bin/activate && \
pip install --no-cache-dir -r requirements.txt
# Runtime Stage
FROM debian:bookworm-slim AS runtime
RUN apt-get update && \
apt-get install -y curl ffmpeg python3 && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
WORKDIR /sam2-playground
COPY . .
COPY --from=builder /sam2-playground/venv /sam2-playground/venv
ENV PATH="/sam2-playground/venv/bin:$PATH"
ENV LD_LIBRARY_PATH="/sam2-playground/venv/lib64/python3.11/site-packages/nvidia/cublas/lib:/sam2-playground/venv/lib64/python3.11/site-packages/nvidia/cudnn/lib"
ENTRYPOINT ["python", "app.py"]