-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (56 loc) · 1.84 KB
/
Dockerfile
File metadata and controls
69 lines (56 loc) · 1.84 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ARG PLATFORM=linux/x86_64
ARG BASE_IMAGE=python:3.13.11-slim
FROM --platform=$PLATFORM $BASE_IMAGE AS uv-installed
# Disable pip warnings https://stackoverflow.com/a/72551258
ENV PIP_ROOT_USER_ACTION=ignore
LABEL [email protected]
RUN DEBIAN_FRONTEND=noninteractive apt-get update -y --no-install-recommends && \
apt-get install -y --no-install-recommends locales && \
locale-gen en_US.UTF-8 && \
apt-get install -y --no-install-recommends \
make \
automake \
libpq-dev \
libffi-dev \
gfortran \
g++ \
git \
libboost-program-options-dev \
libtool \
libxrender1 \
wget \
ca-certificates \
curl \
mandoc \
unzip && \
apt-get clean -y && \
rm -rf /var/lib/apt/lists/*
# Install uv.
ADD https://astral.sh/uv/0.9.26/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
ENV PATH="/root/.local/bin/:$PATH" \
UV_SYSTEM_PYTHON=1
# This is the primary build target used for the production image
FROM --platform=$PLATFORM uv-installed AS production
COPY requirements-full.txt .
RUN uv pip install --no-progress --no-cache -r requirements-full.txt && \
rm requirements-full.txt
# Instruct joblib to use disk for temporary files. Joblib defaults to
# /shm when that directory is present. In the Docker container, /shm is
# present but defaults to 64 MB.
# https://github.com/joblib/joblib/blob/0.11/joblib/parallel.py#L328L342
ENV JOBLIB_TEMP_FOLDER=/tmp
ENV VERSION=8.4.0 \
VERSION_MAJOR=8 \
VERSION_MINOR=4 \
VERSION_MICRO=0
# This build target is for testing in CircleCI.
FROM --platform=$PLATFORM production AS test
COPY .circleci/test_image.py .
COPY CHANGELOG.md .
# This build target is for updating dependencies.
# See generate-requirements.full.sh.
FROM --platform=$PLATFORM uv-installed AS update-deps
CMD ["/bin/bash"]
# Default to the production build target.
FROM production