mianban / Dockerfile
BG5's picture
Update Dockerfile
0fd4a0e verified
raw
history blame
1.45 kB
FROM ubuntu
# 设置环境变量,避免交互式配置
ARG DEBIAN_FRONTEND=noninteractive
# 设置时区为亚洲/上海
ENV TZ=Asia/Shanghai
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
# 创建日志目录并设置权限
RUN mkdir -p /var/log/webmin && \
# chown 777 /var/log/webmin && \
# chmod 777 /etc/webmin && \
# chmod 777 /etc/webmin/miniserv.conf && \
# chmod 777 /etc/webmin/.start-init && \
chown 777 /var && \
chmod 777 /etc && \
chmod 777 /root && \
chmod 777 /var
# 安装所需的软件包并清理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
# 设置工作目录为/app
WORKDIR /root
COPY . .
# 安装任何需要的包,使用 --ignore-installed 选项
RUN pip install --no-cache-dir --ignore-installed --break-system-packages -r requirements.txt
EXPOSE 7860
CMD ["sh", "-c", "service webmin start && python main.py"]