소스 검색

使用uv

develop
H Vs 4 시간 전
부모
커밋
a39c11a556
1개의 변경된 파일39개의 추가작업 그리고 11개의 파일을 삭제
  1. +39
    -11
      docker/Dockerfile.latest

+ 39
- 11
docker/Dockerfile.latest 파일 보기

@@ -1,32 +1,60 @@
#FROM python:3.10-slim-bullseye
FROM 139.224.254.18:5000/ssjl/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'

# # 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

# ENV BUILD_PREFIX=/app

# ADD . ${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/
# 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"]


FROM 139.224.254.18:5000/ssjl/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

ENV BUILD_PREFIX=/app

ADD . ${BUILD_PREFIX}

# Install uv
RUN /usr/local/bin/python -m pip install --no-cache --upgrade pip \
&& pip install --no-cache uv -i https://mirrors.aliyun.com/pypi/simple/

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/
&& uv pip install --no-cache --system -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"]

Loading…
취소
저장