-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathDockerfile.python-base
More file actions
33 lines (26 loc) · 1.14 KB
/
Dockerfile.python-base
File metadata and controls
33 lines (26 loc) · 1.14 KB
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
FROM ubuntu:jammy-20250415.1
USER root
WORKDIR /app
# Set environment variables to make installation non-interactive
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# Install software-properties-common to get add-apt-repository
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.12 python3.12-dev python3.12-venv && \
apt-get install -y --no-install-recommends build-essential curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
ln -sf /usr/bin/python3.12 /usr/bin/python3 && \
ln -sf /usr/bin/python3 /usr/bin/python
# Install pip using the ensurepip module (available in Python 3.12)
RUN python3.12 -m ensurepip --upgrade && \
ln -sf /usr/local/bin/pip3.12 /usr/bin/pip3 || ln -sf /usr/bin/pip3.12 /usr/bin/pip3 && \
ln -sf /usr/bin/pip3 /usr/bin/pip
RUN pip3 install --no-cache-dir --upgrade pip setuptools wheel
COPY dependencies/ /app/dependencies
COPY requirements.txt /app/
# Install wheel files
RUN pip3 install --no-index --find-links=/app/dependencies/ /app/dependencies/*.whl