-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathDockerfile
31 lines (24 loc) · 1.23 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
# 基于的基础镜像
FROM python:3.8.7
# 复制当前文件到容器中的 /icp_Api 目录
COPY ./* /icp_Api/
# 确保 /icp_Api 是目录
RUN mkdir -p /icp_Api
# 设置工作目录
WORKDIR /icp_Api
# 更新 apt 源并安装依赖
RUN echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main non-free contrib' > /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main non-free contrib' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main non-free contrib' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main non-free contrib' >> /etc/apt/sources.list \
&& apt-get update -y \
&& apt-get install -y libgl1 \
&& rm -rf /var/lib/apt/lists/*
# 安装 Python 依赖
RUN pip install -r /icp_Api/requirements.txt -i https://mirrors.aliyun.com/pypi/simple
# 暴露端口
EXPOSE 16181
# 启动应用
CMD ["python3", "/icp_Api/icpApi.py"]