-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_cu128
More file actions
53 lines (41 loc) · 1.63 KB
/
Dockerfile_cu128
File metadata and controls
53 lines (41 loc) · 1.63 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
# Dockerfile
FROM nvidia/cuda:12.8.1-cudnn-runtime-ubuntu22.04
ARG PROXY=""
ARG USE_OLD_TRANSFORMERS=0
ENV DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PYTHONDONTWRITEBYTECODE=1 \
TRANSFORMERS_CACHE=/workspace/.hf \
HF_HOME=/workspace/.hf \
HF_ENDPOINT=https://hf-mirror.com \
TZ=Asia/Shanghai
RUN chmod 1777 /tmp && apt-get update && apt-get install -y \
curl wget ca-certificates \
tar \
&& update-ca-certificates && rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y tzdata && \
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
RUN apt-get update && apt-get install -y python3 python3-pip git ffmpeg libglib2.0-0 libsm6 libxrender1 libxext6 && \
ln -s /usr/bin/python3 /usr/bin/python
RUN pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple
RUN pip3 config set install.trusted-host mirrors.aliyun.com
RUN pip3 install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cu128
RUN if [ "$USE_OLD_TRANSFORMERS" = "1" ]; then \
pip3 install -U --no-cache-dir "transformers>=4.40,<4.45"; \
else \
pip3 install -U --no-cache-dir transformers; \
fi && \
pip3 install -U --no-cache-dir FlagEmbedding uvicorn fastapi open-clip-torch timm onnxruntime-gpu
WORKDIR /app
COPY manager/ /app/manager/
COPY worker/ /app/worker/
COPY start.sh /app/
# 默认启动 Manager
ENV HOST=0.0.0.0 PORT=18000
EXPOSE 18000
# CMD ["uvicorn", "manager.app:app", "--host", "0.0.0.0", "--port", "18000"]
CMD ["/app/start.sh"]