-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
76 lines (60 loc) · 2.31 KB
/
Dockerfile
File metadata and controls
76 lines (60 loc) · 2.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/opt/conda/bin:$PATH \
PIP_EXTRA_INDEX_URL="https://pypi.ngc.nvidia.com https://download.pytorch.org/whl/cu121" \
PIP_FIND_LINKS="https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.5.1_cu121.html"
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
bzip2 \
ca-certificates \
curl \
ffmpeg \
git \
libgl1 \
libglib2.0-0 \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh \
&& bash /tmp/miniconda.sh -b -p /opt/conda \
&& rm -f /tmp/miniconda.sh \
&& conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main \
&& conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r \
&& conda update -n base -c defaults conda -y
WORKDIR /workspace/SAM3DServer
COPY . /workspace/SAM3DServer
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ENV HTTP_PROXY=${HTTP_PROXY} \
HTTPS_PROXY=${HTTPS_PROXY} \
NO_PROXY=${NO_PROXY} \
http_proxy=${HTTP_PROXY} \
https_proxy=${HTTPS_PROXY} \
no_proxy=${NO_PROXY}
SHELL ["/bin/bash", "-lc"]
RUN conda create -n sam python=3.10 -y \
&& conda run -n sam --no-capture-output pip install -r requirements/requirement_sam.txt
RUN conda create -n sam3d-objects python=3.11 -y
RUN chmod +x scripts/setup_sam3d_env.sh
RUN CONDA_PREFIX=/opt/conda/envs/sam3d-objects ENV_NAME=sam3d-objects \
bash scripts/setup_sam3d_env.sh
ENV PYTHONPATH=/workspace/SAM3DServer \
THIRD_PARTY_ROOT=/workspace/SAM3DServer/third_party \
MODEL_ROOT=/models \
SAM_CHECKPOINT=/models/sam/sam_vit_h_4b8939.pth \
SAM3D_CONFIG_PATH=/models/sam3d/checkpoints/hf/pipeline.yaml \
SAM_HTTP_JOB_ROOT=/var/lib/sam-http/jobs \
SAM_HTTP_JOB_TTL_HOURS=24 \
SAM_INTERNAL_BASE_URL=http://127.0.0.1:9001 \
SAM3D_INTERNAL_BASE_URL=http://127.0.0.1:9002 \
SAM_HTTP_BASE_URL=http://127.0.0.1:8004
ENV HTTP_PROXY= \
HTTPS_PROXY= \
NO_PROXY= \
http_proxy= \
https_proxy= \
no_proxy=
RUN mkdir -p /models /var/lib/sam-http/jobs \
&& chmod +x scripts/ensure_models.sh scripts/start_sam_http.sh
EXPOSE 9001 9002 8004
ENTRYPOINT ["bash", "scripts/start_sam_http.sh"]