forked from rayonlabs/vision-workers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.image_server
81 lines (64 loc) · 1.97 KB
/
Dockerfile.image_server
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
77
78
79
80
81
FROM nvidia/cuda:11.8.0-devel-ubuntu20.04
WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive
# PM2
RUN apt-get update && apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g pm2
# Installing necessary packages
RUN apt-get update && apt-get install -y wget git
# Installing Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
&& chmod 700 Miniconda3-latest-Linux-x86_64.sh \
&& ./Miniconda3-latest-Linux-x86_64.sh -b \
&& rm Miniconda3-latest-Linux-x86_64.sh
ENV PATH="/root/miniconda3/bin:${PATH}"
RUN conda create -n venv_image python=3.10.13 -y
ENV PATH="/root/miniconda3/envs/venv_image/bin:${PATH}"
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get -y full-upgrade \
&& apt-get -y install python3-dev \
&& apt-get install -y --no-install-recommends \
build-essential \
python3-pip\
apt-utils \
curl \
wget \
vim \
sudo \
git \
ffmpeg \
libsm6 \
libxext6 \
python3-tk \
python3-dev \
git-lfs \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y unzip
COPY image_server/requirements.txt /app/requirements.txt
RUN pip install --upgrade pip \
&& pip install --upgrade pip setuptools==69.5.1 \
&& pip install -r /app/requirements.txt \
&& pip install huggingface_hub[hf_transfer] \
&& rm -rf /root/.cache/pip/*
COPY image_server /app/image_server
ENV APP_HOST=0.0.0.0
ENV APP_PORT=8080
ENV HF_HUB_ENABLE_HF_TRANSFER=1
USER root
ENV DEVICE=0
ENV VRAM_MODE=--normalvram
ENV WARMUP=false
RUN chmod +x /app/image_server/entrypoint.sh
RUN chmod +x /app/image_server/setup.sh
RUN mkdir /app/cache \
&& mkdir /app/cache/hub \
&& chmod -R 777 /app/cache \
&& chmod -R 777 /app/cache/hub
ENV HF_HOME=/app/cache
ENV HF_HUB_CACHE=/app/cache/hub
CMD ["sh", "-c", "cd /app/image_server && ./entrypoint.sh"]