Spaces:
Sleeping
Sleeping
File size: 1,375 Bytes
526927a |
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 |
# GPU ํ๊ฒฝ์ ์ํ Dockerfile
FROM nvidia/cuda:11.8-devel-ubuntu20.04
# ํ๊ฒฝ ๋ณ์ ์ค์
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
ENV CUDA_VISIBLE_DEVICES=0
# ์์คํ
ํจํค์ง ์
๋ฐ์ดํธ ๋ฐ ์ค์น
RUN apt-get update && apt-get install -y \
python3.9 \
python3.9-dev \
python3-pip \
git \
wget \
curl \
build-essential \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Python 3.9์ ๊ธฐ๋ณธ์ผ๋ก ์ค์
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.9 1
# ์์
๋๋ ํ ๋ฆฌ ์ค์
WORKDIR /app
# Python ์์กด์ฑ ํ์ผ ๋ณต์ฌ
COPY requirements.txt .
# Python ํจํค์ง ์ค์น
RUN pip3 install --no-cache-dir -r requirements.txt
# GPU ๊ด๋ จ ํจํค์ง ์ค์น
RUN pip3 install --no-cache-dir \
torch==2.0.1+cu118 \
torchvision==0.15.2+cu118 \
torchaudio==2.0.2+cu118 \
--index-url https://download.pytorch.org/whl/cu118
# ํ๋ก์ ํธ ํ์ผ ๋ณต์ฌ
COPY . .
# ํฌํธ ์ค์
EXPOSE 8001
# ํฌ์ค์ฒดํฌ ์ถ๊ฐ
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8001/health || exit 1
# ์คํ ๋ช
๋ น
CMD ["python3", "run_server_v2.py"] |