From 60edc1f2b8cc1c440c36a213820384c2fa5f5a5f Mon Sep 17 00:00:00 2001 From: H Vs Date: Wed, 23 Apr 2025 10:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile.latest | 24 +++--------------- docker/Dockerfile.latest.bk | 50 +++++++++++++++++++++++++++++++++++++ docker/python.Dockerfile | 17 +++++++++++++ 3 files changed, 70 insertions(+), 21 deletions(-) create mode 100644 docker/Dockerfile.latest.bk create mode 100644 docker/python.Dockerfile diff --git a/docker/Dockerfile.latest b/docker/Dockerfile.latest index db459d9..e1576f0 100644 --- a/docker/Dockerfile.latest +++ b/docker/Dockerfile.latest @@ -1,4 +1,5 @@ -FROM python:3.10-slim-bullseye +#FROM python:3.10-slim-bullseye +FROM 139.224.254.18:5000/ssjl/python:3.10-slim-bullseye LABEL maintainer="foo@bar.com" ARG TZ='Asia/Shanghai' @@ -7,30 +8,11 @@ ARG TZ='Asia/Shanghai' #RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list - -# Set the timezone and configure tzdata -# RUN apt-get update \ -# && apt-get install -y --no-install-recommends tzdata \ -# && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ -# && dpkg-reconfigure --frontend noninteractive tzdata \ -# && apt-get clean - - -# RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime - -RUN apt-get install -y --no-install-recommends tzdata \ -&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ -&& dpkg-reconfigure --frontend noninteractive tzdata \ -&& apt-get clean - - ENV BUILD_PREFIX=/app ADD . ${BUILD_PREFIX} -RUN apt-get update \ - &&apt-get install -y --no-install-recommends bash ffmpeg espeak libavcodec-extra\ - && cd ${BUILD_PREFIX} \ +RUN cd ${BUILD_PREFIX} \ && cp config-template.json config.json \ && /usr/local/bin/python -m pip install --no-cache --upgrade pip \ && pip install --no-cache -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ diff --git a/docker/Dockerfile.latest.bk b/docker/Dockerfile.latest.bk new file mode 100644 index 0000000..a55318b --- /dev/null +++ b/docker/Dockerfile.latest.bk @@ -0,0 +1,50 @@ +FROM python:3.10-slim-bullseye + +LABEL maintainer="foo@bar.com" +ARG TZ='Asia/Shanghai' + +# RUN echo /etc/apt/sources.list +#RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list +RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list + + +# Set the timezone and configure tzdata +# RUN apt-get update \ +# && apt-get install -y --no-install-recommends tzdata \ +# && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ +# && dpkg-reconfigure --frontend noninteractive tzdata \ +# && apt-get clean + + +# RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime + +RUN apt-get install -y --no-install-recommends tzdata \ +&& ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ +&& dpkg-reconfigure --frontend noninteractive tzdata \ +&& apt-get clean + + +ENV BUILD_PREFIX=/app + +ADD . ${BUILD_PREFIX} + +RUN apt-get update \ + && apt-get install -y --no-install-recommends bash ffmpeg espeak libavcodec-extra\ + && cd ${BUILD_PREFIX} \ + && cp config-template.json config.json \ + && /usr/local/bin/python -m pip install --no-cache --upgrade pip \ + && pip install --no-cache -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ + +WORKDIR ${BUILD_PREFIX} + +ADD docker/entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh \ + && mkdir -p /home/noroot \ + && groupadd -r noroot \ + && useradd -r -g noroot -s /bin/bash -d /home/noroot noroot \ + && chown -R noroot:noroot /home/noroot ${BUILD_PREFIX} /usr/local/lib + +USER noroot + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker/python.Dockerfile b/docker/python.Dockerfile new file mode 100644 index 0000000..fa2f621 --- /dev/null +++ b/docker/python.Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.10-slim-bullseye + +LABEL maintainer="foo@bar.com" +ARG TZ='Asia/Shanghai' + +# RUN echo /etc/apt/sources.list +# RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list +RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list + + +# Set the timezone and configure tzdata +RUN apt-get update \ + && apt-get install -y --no-install-recommends bash ffmpeg espeak libavcodec-extra \ + && apt-get install -y --no-install-recommends tzdata \ + && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ + && dpkg-reconfigure --frontend noninteractive tzdata \ + && apt-get clean