Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,202 Bytes
c9cc441 5f87f80 c9cc441 2a78754 c9cc441 721391f c9cc441 dd5dfc8 |
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 |
# CUDA 12.1ベースのUbuntuイメージを使用
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04
RUN ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
# 必要なパッケージをインストール
RUN apt-get update && apt-get install -y \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y \
python3.10 \
python3.10-dev \
python3.10-distutils \
wget \
&& rm -rf /var/lib/apt/lists/*
# pipのインストール
RUN wget https://bootstrap.pypa.io/get-pip.py \
&& python3.10 get-pip.py \
&& rm get-pip.py
# デフォルトのpythonとpipコマンドをpython3.10とpip3.10にリンク
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1 \
&& update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.10 1
WORKDIR /app
RUN useradd -m -u 1000 user
USER user
# 依存関係をインストール
COPY requirements.txt /app/
RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends libopencv-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY . /app
EXPOSE 80
CMD ["python", "app.py", "--use_gpu"]
|