improve installation of pip packages

This commit is contained in:
Gerrit Gogel 2023-10-18 20:39:23 +02:00
parent 73c39f26cb
commit 9387cbdad7

View file

@ -30,7 +30,7 @@ openldap-dev \
python3-dev python3-dev
RUN python3 -m pip install --upgrade pip &&\ RUN python3 -m pip install --upgrade pip &&\
pip3 install --timeout=3600 \ pip3 install --target /pip-deps --timeout=3600 --no-cache-dir \
future==0.18.* \ future==0.18.* \
pillow==10.0.* \ pillow==10.0.* \
captcha==0.4 \ captcha==0.4 \
@ -42,8 +42,10 @@ django-simple-captcha==0.5.* \
pycryptodome==3.18.* \ pycryptodome==3.18.* \
djangosaml2==1.5.* \ djangosaml2==1.5.* \
python-ldap==3.4.* \ python-ldap==3.4.* \
sqlalchemy==2.0.* \ sqlalchemy==2.0.*
&& rm -r /root/.cache/pip
RUN find /pip-deps -name "__pycache__" -type d -exec rm -r {} + && \
rm -rf /pip-deps/pip /pip-deps/wheel /pip-deps/setuptools
FROM python:3.10.13-alpine3.18 FROM python:3.10.13-alpine3.18
@ -63,8 +65,7 @@ netcat-openbsd \
gcompat \ gcompat \
openldap openldap
COPY --from=pip /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages COPY --from=pip /pip-deps /usr/local/lib/python3.10/site-packages
COPY --from=get /tmp/seafile-server*/seahub /opt/seafile/seafile-server-latest/seahub COPY --from=get /tmp/seafile-server*/seahub /opt/seafile/seafile-server-latest/seahub
COPY --from=get /tmp/seafile-server*/runtime /opt/seafile/seafile-server-latest/runtime COPY --from=get /tmp/seafile-server*/runtime /opt/seafile/seafile-server-latest/runtime
COPY --from=get /tmp/seafile-server*/seahub.sh /opt/seafile/seafile-server-latest/seahub.sh COPY --from=get /tmp/seafile-server*/seahub.sh /opt/seafile/seafile-server-latest/seahub.sh
@ -73,8 +74,8 @@ COPY --from=get /tmp/seafile-server*/seafile/lib/python3/site-packages /opt/seaf
COPY --from=get /tmp/seafile-server*/pro/python/seafevents /opt/seafile/seafile-server-latest/pro/python/seafevents COPY --from=get /tmp/seafile-server*/pro/python/seafevents /opt/seafile/seafile-server-latest/pro/python/seafevents
COPY scripts /scripts COPY scripts /scripts
RUN chmod u+x /scripts/* RUN chmod u+x /scripts/*
RUN mkdir -p /opt/seafile/logs &&\ RUN mkdir -p /opt/seafile/logs &&\
touch /opt/seafile/logs/seahub.log &&\ touch /opt/seafile/logs/seahub.log &&\
mkdir -p /opt/seafile/pids mkdir -p /opt/seafile/pids