This commit is contained in:
2024-10-24 09:04:38 +08:00
parent 2a18f10bcf
commit 641c34b1b3
20 changed files with 2817 additions and 0 deletions

32
meian/Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
# 将官方 Python 运行时用作父镜像
FROM python:3.10.13-slim-bullseye
# 工作目录设置
RUN mkdir -p /app
WORKDIR /app/meian
# 将文件复制到容器中
COPY btop ./sources.list.bullseye ./requirements.txt ./*.py /app/meian/
COPY ./data /app/meian/data
COPY ./devices /app/meian/devices
RUN export TZ=Asia/Shanghai \
&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& export http_proxy=$proxy_url && export https_proxy=$proxy_url \
&& mv sources.list.bullseye /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y iputils-ping vim net-tools telnet sqlite3 curl \
&& pip install --no-cache-dir -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com --timeout 1000 \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& unset http_proxy \
&& unset https_proxy
RUN echo "alias ll='ls -alh --color'" >> /root/.bashrc
RUN echo "alias ll='ls -alh --color'" >> /root/.profile
# 0: 本地环境1测试容器环境2: 生产容器环境3: 本地开发环境
ENV ENV_TYPE=2
#CMD ["sleep", "3600"]
CMD ["python", "app.py"]