-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathDockerfile-base
36 lines (29 loc) · 1.28 KB
/
Dockerfile-base
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
FROM python:3.13.1-slim
# Install APT dependencies
ARG DEPENDENCIES=" \
curl \
g++ \
make \
pkg-config \
libmariadb-dev \
gettext"
ARG APT_MIRROR=http://deb.debian.org
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core \
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core \
set -ex \
&& rm -f /etc/apt/apt.conf.d/docker-clean \
&& echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache \
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources \
&& apt-get update > /dev/null \
&& apt-get -y install --no-install-recommends ${DEPENDENCIES} \
&& echo "no" | dpkg-reconfigure dash
# install pip
WORKDIR /data/
ARG PIP_MIRROR=https://pypi.org/simple
RUN --mount=type=cache,target=/root/.cache,id=core \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
set -ex \
&& python3 -m venv /data/py3 \
&& . /data/py3/bin/activate \
&& pip install -U setuptools pip --ignore-installed -i ${PIP_MIRROR} \
&& pip install --no-cache-dir -r requirements.txt -i ${PIP_MIRROR}