File size: 1,203 Bytes
d457e1e
 
 
 
 
 
088a2ee
 
6e1b090
be96286
e843ed0
 
 
 
 
 
 
 
 
 
 
 
 
d457e1e
8beb0b9
 
 
 
 
 
 
 
 
 
 
 
 
 
22ddbb9
335473a
d457e1e
d03c38d
 
 
1501761
 
3c92ffa
a9152bd
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
FROM ubuntu
# 设置环境变量,避免交互式配置
ARG DEBIAN_FRONTEND=noninteractive
# 设置时区为亚洲/上海
ENV TZ=Asia/Shanghai
# 设置工作目录为/app
WORKDIR /code
COPY . .
EXPOSE 7860
RUN rm -rf /var/lib/apt/lists/*
# 安装必要的工具
RUN apt-get update && \
    apt-get install -y wget gnupg && \
    rm -rf /var/lib/apt/lists/*

# 添加 Webmin 的 GPG 密钥
RUN wget https://download.webmin.com/jcameron-key.asc && \
    apt-key add jcameron-key.asc

# 添加 Webmin 的源
RUN echo "deb https://download.webmin.com/download/repository sarge contrib" >> /etc/apt/sources.list.d/webmin.list


# 安装所需的软件包并清理APT缓存
RUN apt-get update && apt-get install -y \
    wget \
    python-is-python3 \
    pip \
    tar \
    unzip \
    zip \
    curl \
    git \
    sudo \
    gosu \
    gnupg \
    util-linux \
    sqlite3 \
    tzdata \
    webmin
# 下载并执行 install.sh 脚本
# 同时运行 python main.py 和 bash install.sh
# RUN python main.py & \
#     bash quick_start.sh
# 安装任何需要的包,使用 --ignore-installed 选项
RUN pip install --no-cache-dir --ignore-installed -r requirements.txt

CMD ["sh", "-c", "python main.py"]