-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
38 lines (29 loc) · 1.1 KB
/
Dockerfile
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
FROM ubuntu:22.04
MAINTAINER suke119
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
ffmpeg \
wget \
bzip2
# 下载并安装Miniconda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh && \
chmod +x Miniconda3-py37_4.10.3-Linux-x86_64.sh && \
./Miniconda3-py37_4.10.3-Linux-x86_64.sh -b -p /opt/conda && \
rm Miniconda3-py37_4.10.3-Linux-x86_64.sh
# 将Miniconda添加到环境变量中
ENV PATH="/opt/conda/bin:${PATH}"
# 创建并激活Python 3.7环境
RUN conda create -y --name py37 python=3.7 && \
echo "source activate py37" >> ~/.bashrc
ENV PATH="/opt/conda/envs/py37/bin:${PATH}"
WORKDIR /app
COPY ./server /app
RUN pip install --upgrade pip -i https://pypi.douban.com/simple && \
pip uninstall -y protobuf && \
pip install protobuf==3.19.0 -i https://pypi.douban.com/simple && \
pip install -r requirements.txt -i https://pypi.douban.com/simple
RUN pip install opencv-python-headless -i https://pypi.douban.com/simple
CMD uvicorn main:app --reload --port 18080 --host 0.0.0.0